Skip to content

Commit

Permalink
chore: update for upgrading version to 3.x; rename dir test-cases
Browse files Browse the repository at this point in the history
… to `test` 🆙
  • Loading branch information
oldratlee committed Apr 12, 2024
1 parent d0ccd2b commit fda8453
Show file tree
Hide file tree
Showing 36 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# https://docs.github.com/en/actions/learn-github-actions/variables#detecting-the-operating-system
# https://docs.github.com/en/actions/learn-github-actions/expressions
if: runner.os == 'macOS'
- run: test-cases/integration-test.sh
- run: test/integration-test.sh
# https://remarkablemark.org/blog/2017/10/12/check-git-dirty/
- name: Check git dirty
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- run: test-cases/lint.sh
- run: test/lint.sh
# https://remarkablemark.org/blog/2017/10/12/check-git-dirty/
- name: Check git dirty
run: |
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "test-cases/shunit2"]
path = test-cases/shunit2-lib
[submodule "test/shunit2"]
path = test/shunit2-lib
url = https://github.com/kward/shunit2.git
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# <div align="center"><a href="#dummy"><img src="https://github.com/oldratlee/useful-scripts/assets/1063891/990d7ab3-1a84-4024-b1c6-4c8d441dcfc6" alt="🐌 useful-scripts"></a></div>

<p align="center">
<a href="https://github.com/oldratlee/useful-scripts/actions/workflows/ci.yaml"><img src="https://img.shields.io/github/actions/workflow/status/oldratlee/useful-scripts/ci.yaml?branch=dev-2.x&logo=github&logoColor=white" alt="Github Workflow Build Status"></a>
<a href="https://github.com/oldratlee/useful-scripts/actions/workflows/ci.yaml"><img src="https://img.shields.io/github/actions/workflow/status/oldratlee/useful-scripts/ci.yaml?branch=dev-3.x&logo=github&logoColor=white" alt="Github Workflow Build Status"></a>
<a href="https://github.com/oldratlee/useful-scripts/releases"><img src="https://img.shields.io/github/release/oldratlee/useful-scripts.svg" alt="GitHub release"></a>
<a href="https://www.apache.org/licenses/LICENSE-2.0.html"><img src="https://img.shields.io/github/license/oldratlee/useful-scripts?color=4D7A97&logo=apache" alt="License"></a>
<a href="https://github.com/oldratlee/useful-scripts/stargazers"><img src="https://img.shields.io/github/stars/oldratlee/useful-scripts?style=flat" alt="GitHub Stars"></a>
Expand Down Expand Up @@ -52,7 +52,7 @@
----------------------

```bash
source <(curl -fsSL https://raw.githubusercontent.com/oldratlee/useful-scripts/release-2.x/test-cases/self-installer.sh)
source <(curl -fsSL https://raw.githubusercontent.com/oldratlee/useful-scripts/release-3.x/test/self-installer.sh)
```

更多下载&使用方式,参见[下载使用](docs/install.md)
Expand Down
2 changes: 1 addition & 1 deletion bin/a2l
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# $ ./a2l arg1 arg2
# $ ./a2l *.txt
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-a2l
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-a2l
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/ap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# # print Absolute Path of arguments.
# $ ./ap a.txt ../dir1/b.txt
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-ap-and-rp
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-ap-and-rp
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# $ ls -l | c
# $ c -q < ~/.ssh/id_rsa.pub
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-c
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-c
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/coat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# $ coat /path/to/file1
# $ coat /path/to/file1 /path/to/file2
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-coat
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-coat
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/cp-into-docker-run
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Example:
# cp-into-docker-run -c container_foo command_copied_into_container command_arg1
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-cp-into-docker-run
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-cp-into-docker-run
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/echo-args
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @Function
# print arguments in human and debugging friendly style.
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-echo-args
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-echo-args
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/find-in-jars
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# $ find-in-jars 'Service\.class$' -e jar -e zip
# $ find-in-jars 'Mon[^$/]*Service\.class$' -s ' <-> '
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/java.md#-find-in-jars
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/java.md#-find-in-jars
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/rp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# # if more than 1 argument, print relative path to last argument.
# $ ./rp a.txt ../b.txt /etc/passwd /etc/apache2
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-ap-and-rp
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-ap-and-rp
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/show-busy-java-threads
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @Usage
# $ ./show-busy-java-threads
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/java.md#-show-busy-java-threads
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/java.md#-show-busy-java-threads
# @author Jerry Lee (oldratlee at gmail dot com)
# @author superhj1987 (superhj1987 at 126 dot com)

Expand Down
2 changes: 1 addition & 1 deletion bin/show-duplicate-java-classes
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# $ show-duplicate-java-classes -L path/to/lib_dir1 # search jars in the subdirectories of lib dir
# $ show-duplicate-java-classes -J path/to/lib_dir1 # search jars in the jar file
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/java.md#-show-duplicate-java-classes
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/java.md#-show-duplicate-java-classes
# @author tg123 (farmer1992 at gmail dot com)
# @author Jerry Lee (oldratlee at gmail dot com)

Expand Down
2 changes: 1 addition & 1 deletion bin/taoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# $ taoc /path/to/file1
# $ taoc /path/to/file1 /path/to/file2
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-coat
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-coat
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/tcp-connection-state-counter
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @Usage
# $ ./tcp-connection-state-counter
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-tcp-connection-state-counter
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-tcp-connection-state-counter
# @author Jerry Lee (oldratlee at gmail dot com)
# @author @sunuslee (sunuslee at gmail dot com)
set -eEuo pipefail
Expand Down
2 changes: 1 addition & 1 deletion bin/uq
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# @Usage
# uq [OPTION]... [INPUT [OUTPUT]]
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-uq
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-uq
# @author Zava Xu (zava.kid at gmail dot com)
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail
Expand Down
2 changes: 1 addition & 1 deletion bin/xpf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# @Usage
# $ ./xpf file
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-xpl-and-xpf
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-xpl-and-xpf
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
2 changes: 1 addition & 1 deletion bin/xpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @Usage
# $ ./xpf [file [file ...] ]
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-xpl-and-xpf
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-xpl-and-xpf
# @author Jerry Lee (oldratlee at gmail dot com)
set -eEuo pipefail

Expand Down
20 changes: 10 additions & 10 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ git clone git://github.com/oldratlee/useful-scripts.git
cd useful-scripts

# 使用Release分支的内容
git checkout release-2.x
git checkout release-3.x

# 更新脚本
git pull
```

包含2个分支:

- `dev-2.x`:开发分支
- `release-2.x`:发布分支,功能稳定的脚本
- `dev-3.x`:开发分支
- `release-3.x`:发布分支,功能稳定的脚本

当然如果你不想安装`git``github`是支持`svn`的:

```bash
svn co https://github.com/oldratlee/useful-scripts/branches/release-2.x
svn co https://github.com/oldratlee/useful-scripts/branches/release-3.x

cd useful-scripts

Expand All @@ -41,29 +41,29 @@ PS:

### 打包下载

下载文件[release-2.x.zip](https://github.com/oldratlee/useful-scripts/archive/release-2.x.zip)
下载文件[release-3.x.zip](https://github.com/oldratlee/useful-scripts/archive/release-3.x.zip)

```bash
wget --no-check-certificate https://github.com/oldratlee/useful-scripts/archive/release-2.x.zip
wget --no-check-certificate https://github.com/oldratlee/useful-scripts/archive/release-3.x.zip

unzip release-2.x.zip
unzip release-3.x.zip
```

下载和运行单个文件
-------------------

[`show-busy-java-threads`](https://raw.github.com/oldratlee/useful-scripts/release-2.x/bin/show-busy-java-threads)为例。
[`show-busy-java-threads`](https://raw.github.com/oldratlee/useful-scripts/release-3.x/bin/show-busy-java-threads)为例。

### `curl`文件直接用`bash`运行

```bash
curl -sLk 'https://raw.github.com/oldratlee/useful-scripts/release-2.x/bin/show-busy-java-threads' | bash
curl -sLk 'https://raw.github.com/oldratlee/useful-scripts/release-3.x/bin/show-busy-java-threads' | bash
```

### 下载单个文件

```bash
wget --no-check-certificate https://raw.github.com/oldratlee/useful-scripts/release-2.x/bin/show-busy-java-threads
wget --no-check-certificate https://raw.github.com/oldratlee/useful-scripts/release-3.x/bin/show-busy-java-threads
chmod +x show-busy-java-threads

./show-busy-java-threads
Expand Down
4 changes: 2 additions & 2 deletions docs/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ B.java
# 把参数按行输出方便查看 或是 grep
$ a2l **/*.sh
lib/console-text-color-themes.sh
test-cases/parseOpts_test.sh
test-cases/self-installer.sh
test/parseOpts_test.sh
test/self-installer.sh
...
```
Expand Down
2 changes: 1 addition & 1 deletion legacy-bin/cp-svn-url
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# $ ./cp-svn-url
# $ ./cp-svn-url /path/to/svn/work/dir
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/vcs.md#-cp-svn-url
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/vcs.md#-cp-svn-url
# @author ivanzhangwb (ivanzhangwb at gmail dot com)

readonly PROG=${0##*/}
Expand Down
2 changes: 1 addition & 1 deletion legacy-bin/svn-merge-stop-on-copy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# $ ./svnmerge.sh <source branch> [target branch]
# if no target branch, merge to current svn direcotry
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/vcs.md#-svn-merge-stop-on-copy
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/vcs.md#-svn-merge-stop-on-copy
# @author jiangjizhong(@jzwlqx)
# @author Jerry Lee (oldratlee at gmail dot com)

Expand Down
2 changes: 1 addition & 1 deletion legacy-bin/swtrunk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @Usage
# $ ./swtrunk [<svn work dir>...]
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/vcs.md#-swtrunk
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/vcs.md#-swtrunk
# @author Jerry Lee (oldratlee at gmail dot com)

colorEcho() {
Expand Down
2 changes: 1 addition & 1 deletion lib/console-text-color-themes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @Function
# show all console text color themes.
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-console-text-color-themessh
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-console-text-color-themessh
# @author Jerry Lee (oldratlee at gmail dot com)

colorEcho() {
Expand Down
2 changes: 1 addition & 1 deletion lib/parseOpts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# _OPT_VALUE_c_long = (c.sh -p pv -q qv arg1) # Array type
# _OPT_ARGS = (aa bb cc) # Array type
#
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-2.x/docs/shell.md#-parseoptssh
# @online-doc https://github.com/oldratlee/useful-scripts/blob/dev-3.x/docs/shell.md#-parseoptssh
# @author Jerry Lee (oldratlee at gmail dot com)

#####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ die() {
# biz logic
################################################################################

(($# != 1)) && die "need only 1 argument for version!$NL${NL}usage:$NL $0 2.x.y"
(($# != 1)) && die "need only 1 argument for version!$NL${NL}usage:$NL $0 3.x.y"
readonly bump_version=$1

# adjust current dir to project dir
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test-cases/self-installer.sh → test/self-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if type -P svn &>/dev/null; then
[ ! -d "/tmp/useful-scripts-$USER" ] &&
svn checkout https://github.com/oldratlee/useful-scripts/branches/release-2.x "/tmp/useful-scripts-$USER"
svn checkout https://github.com/oldratlee/useful-scripts/branches/release-3.x "/tmp/useful-scripts-$USER"
fi

export PATH="$PATH:/tmp/useful-scripts-$USER/bin:/tmp/useful-scripts-$USER/legacy-bin"
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fda8453

Please sign in to comment.