From fda8453550426ed7debedd5829ebb9f553b2c8b4 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Fri, 12 Apr 2024 16:11:16 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20update=20for=20upgrading=20version=20t?= =?UTF-8?q?o=20`3.x`;=20rename=20dir=20`test-cases`=20to=20`test`=20?= =?UTF-8?q?=F0=9F=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .gitmodules | 4 ++-- README.md | 4 ++-- bin/a2l | 2 +- bin/ap | 2 +- bin/c | 2 +- bin/coat | 2 +- bin/cp-into-docker-run | 2 +- bin/echo-args | 2 +- bin/find-in-jars | 2 +- bin/rp | 2 +- bin/show-busy-java-threads | 2 +- bin/show-duplicate-java-classes | 2 +- bin/taoc | 2 +- bin/tcp-connection-state-counter | 2 +- bin/uq | 2 +- bin/xpf | 2 +- bin/xpl | 2 +- docs/install.md | 20 ++++++++++---------- docs/shell.md | 4 ++-- legacy-bin/cp-svn-url | 2 +- legacy-bin/svn-merge-stop-on-copy | 2 +- legacy-bin/swtrunk | 2 +- lib/console-text-color-themes.sh | 2 +- lib/parseOpts.sh | 2 +- {test-cases => test}/bump-scripts-version.sh | 2 +- {test-cases => test}/integration-test.sh | 0 {test-cases => test}/lint.sh | 0 {test-cases => test}/my_unit_test_lib.sh | 0 {test-cases => test}/parseOpts_test.sh | 0 {test-cases => test}/self-installer.sh | 2 +- {test-cases => test}/shunit2-lib | 0 {test-cases => test}/uq_test.sh | 0 {test-cases => test}/uq_test_another_input | 0 {test-cases => test}/uq_test_input | 0 36 files changed, 40 insertions(+), 40 deletions(-) rename {test-cases => test}/bump-scripts-version.sh (98%) rename {test-cases => test}/integration-test.sh (100%) rename {test-cases => test}/lint.sh (100%) rename {test-cases => test}/my_unit_test_lib.sh (100%) rename {test-cases => test}/parseOpts_test.sh (100%) rename {test-cases => test}/self-installer.sh (84%) rename {test-cases => test}/shunit2-lib (100%) rename {test-cases => test}/uq_test.sh (100%) rename {test-cases => test}/uq_test_another_input (100%) rename {test-cases => test}/uq_test_input (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2c4b2298..205dc9a0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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: | diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 26788dce..a353427a 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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: | diff --git a/.gitmodules b/.gitmodules index 94904715..6923012c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/README.md b/README.md index 32a6764d..50c0bbd4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ #
🐌 useful-scripts

-Github Workflow Build Status +Github Workflow Build Status GitHub release License GitHub Stars @@ -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)。 diff --git a/bin/a2l b/bin/a2l index 9752fdbd..ea1588b8 100755 --- a/bin/a2l +++ b/bin/a2l @@ -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 diff --git a/bin/ap b/bin/ap index b4790e19..82c30185 100755 --- a/bin/ap +++ b/bin/ap @@ -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 diff --git a/bin/c b/bin/c index fd426e11..b2c1dd15 100755 --- a/bin/c +++ b/bin/c @@ -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 diff --git a/bin/coat b/bin/coat index 7eb2ba7b..dbdb4f4a 100755 --- a/bin/coat +++ b/bin/coat @@ -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 diff --git a/bin/cp-into-docker-run b/bin/cp-into-docker-run index 048ff428..6d008c03 100755 --- a/bin/cp-into-docker-run +++ b/bin/cp-into-docker-run @@ -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 diff --git a/bin/echo-args b/bin/echo-args index 9186a6e3..ca2ea749 100755 --- a/bin/echo-args +++ b/bin/echo-args @@ -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 diff --git a/bin/find-in-jars b/bin/find-in-jars index 7a9d0081..f49e9ec1 100755 --- a/bin/find-in-jars +++ b/bin/find-in-jars @@ -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 diff --git a/bin/rp b/bin/rp index 942810ad..701c8756 100755 --- a/bin/rp +++ b/bin/rp @@ -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 diff --git a/bin/show-busy-java-threads b/bin/show-busy-java-threads index 4fa7fe01..717506ca 100755 --- a/bin/show-busy-java-threads +++ b/bin/show-busy-java-threads @@ -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) diff --git a/bin/show-duplicate-java-classes b/bin/show-duplicate-java-classes index e1b7b226..5da1f73c 100755 --- a/bin/show-duplicate-java-classes +++ b/bin/show-duplicate-java-classes @@ -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) diff --git a/bin/taoc b/bin/taoc index 3ba8614a..461c5ba5 100755 --- a/bin/taoc +++ b/bin/taoc @@ -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 diff --git a/bin/tcp-connection-state-counter b/bin/tcp-connection-state-counter index ce060fae..244bd639 100755 --- a/bin/tcp-connection-state-counter +++ b/bin/tcp-connection-state-counter @@ -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 diff --git a/bin/uq b/bin/uq index 16da32e0..581bfb7c 100755 --- a/bin/uq +++ b/bin/uq @@ -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 diff --git a/bin/xpf b/bin/xpf index 34af6d91..8643c134 100755 --- a/bin/xpf +++ b/bin/xpf @@ -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 diff --git a/bin/xpl b/bin/xpl index 7aa0127d..d9066f82 100755 --- a/bin/xpl +++ b/bin/xpl @@ -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 diff --git a/docs/install.md b/docs/install.md index 5ef3b633..26f9ca29 100644 --- a/docs/install.md +++ b/docs/install.md @@ -14,7 +14,7 @@ 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 @@ -22,13 +22,13 @@ 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 @@ -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 diff --git a/docs/shell.md b/docs/shell.md index 4ff27aac..6d8b0e39 100644 --- a/docs/shell.md +++ b/docs/shell.md @@ -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 ... ``` diff --git a/legacy-bin/cp-svn-url b/legacy-bin/cp-svn-url index f716d6fc..80d122ca 100755 --- a/legacy-bin/cp-svn-url +++ b/legacy-bin/cp-svn-url @@ -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##*/} diff --git a/legacy-bin/svn-merge-stop-on-copy b/legacy-bin/svn-merge-stop-on-copy index 249fa7d2..efc3d8ad 100755 --- a/legacy-bin/svn-merge-stop-on-copy +++ b/legacy-bin/svn-merge-stop-on-copy @@ -7,7 +7,7 @@ # $ ./svnmerge.sh [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) diff --git a/legacy-bin/swtrunk b/legacy-bin/swtrunk index 6578fd3b..5d3aeeab 100755 --- a/legacy-bin/swtrunk +++ b/legacy-bin/swtrunk @@ -5,7 +5,7 @@ # @Usage # $ ./swtrunk [...] # -# @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() { diff --git a/lib/console-text-color-themes.sh b/lib/console-text-color-themes.sh index 70833615..7ffff24d 100755 --- a/lib/console-text-color-themes.sh +++ b/lib/console-text-color-themes.sh @@ -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() { diff --git a/lib/parseOpts.sh b/lib/parseOpts.sh index 86dd0842..d212b8e1 100755 --- a/lib/parseOpts.sh +++ b/lib/parseOpts.sh @@ -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) ##################################################################### diff --git a/test-cases/bump-scripts-version.sh b/test/bump-scripts-version.sh similarity index 98% rename from test-cases/bump-scripts-version.sh rename to test/bump-scripts-version.sh index d71213c4..8af6cadf 100755 --- a/test-cases/bump-scripts-version.sh +++ b/test/bump-scripts-version.sh @@ -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 diff --git a/test-cases/integration-test.sh b/test/integration-test.sh similarity index 100% rename from test-cases/integration-test.sh rename to test/integration-test.sh diff --git a/test-cases/lint.sh b/test/lint.sh similarity index 100% rename from test-cases/lint.sh rename to test/lint.sh diff --git a/test-cases/my_unit_test_lib.sh b/test/my_unit_test_lib.sh similarity index 100% rename from test-cases/my_unit_test_lib.sh rename to test/my_unit_test_lib.sh diff --git a/test-cases/parseOpts_test.sh b/test/parseOpts_test.sh similarity index 100% rename from test-cases/parseOpts_test.sh rename to test/parseOpts_test.sh diff --git a/test-cases/self-installer.sh b/test/self-installer.sh similarity index 84% rename from test-cases/self-installer.sh rename to test/self-installer.sh index 801e7a79..ce1d6f60 100644 --- a/test-cases/self-installer.sh +++ b/test/self-installer.sh @@ -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" diff --git a/test-cases/shunit2-lib b/test/shunit2-lib similarity index 100% rename from test-cases/shunit2-lib rename to test/shunit2-lib diff --git a/test-cases/uq_test.sh b/test/uq_test.sh similarity index 100% rename from test-cases/uq_test.sh rename to test/uq_test.sh diff --git a/test-cases/uq_test_another_input b/test/uq_test_another_input similarity index 100% rename from test-cases/uq_test_another_input rename to test/uq_test_another_input diff --git a/test-cases/uq_test_input b/test/uq_test_input similarity index 100% rename from test-cases/uq_test_input rename to test/uq_test_input