diff --git a/tools/init b/tools/init index 1848f9b..5ea1da0 100755 --- a/tools/init +++ b/tools/init @@ -21,7 +21,7 @@ help() { check_status() { if [[ -n $(git status . -s) ]]; then echo "Error: Commit unstaged files first, and then run this tool again." - exit -1 + exit 1 fi } @@ -33,7 +33,8 @@ check_init() { else if [[ -f .github/workflows/$ACTIONS_WORKFLOW ]]; then # on BSD, the `wc` could contains blank - local _count="$(find .github/workflows/ -type f -name "*.yml" | wc -l)" + local _count + _count=$(find .github/workflows/ -type f -name "*.yml" | wc -l) if [[ ${_count//[[:blank:]]/} == 1 ]]; then _has_inited=true fi @@ -47,7 +48,7 @@ check_init() { } checkout_latest_tag() { - tag=$(git describe --tags $(git rev-list --tags --max-count=1)) + tag=$(git describe --tags "$(git rev-list --tags --max-count=1)") git reset --hard "$tag" } diff --git a/tools/release b/tools/release index b9cdfbc..f6bc6d0 100755 --- a/tools/release +++ b/tools/release @@ -104,7 +104,7 @@ check() { _bump_file() { for i in "${!FILES[@]}"; do - if [[ ${FILES[$i]} == $NODE_CONFIG ]]; then + if [[ ${FILES[$i]} == "$NODE_CONFIG" ]]; then continue fi