Skip to content

Commit 4490ce4

Browse files
committed
refactor(tools): fix shell check issues
1 parent d0cf2a8 commit 4490ce4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tools/init

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ help() {
2121
check_status() {
2222
if [[ -n $(git status . -s) ]]; then
2323
echo "Error: Commit unstaged files first, and then run this tool again."
24-
exit -1
24+
exit 1
2525
fi
2626
}
2727

@@ -33,7 +33,8 @@ check_init() {
3333
else
3434
if [[ -f .github/workflows/$ACTIONS_WORKFLOW ]]; then
3535
# on BSD, the `wc` could contains blank
36-
local _count="$(find .github/workflows/ -type f -name "*.yml" | wc -l)"
36+
local _count
37+
_count=$(find .github/workflows/ -type f -name "*.yml" | wc -l)
3738
if [[ ${_count//[[:blank:]]/} == 1 ]]; then
3839
_has_inited=true
3940
fi
@@ -47,7 +48,7 @@ check_init() {
4748
}
4849

4950
checkout_latest_tag() {
50-
tag=$(git describe --tags $(git rev-list --tags --max-count=1))
51+
tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
5152
git reset --hard "$tag"
5253
}
5354

tools/release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ check() {
104104

105105
_bump_file() {
106106
for i in "${!FILES[@]}"; do
107-
if [[ ${FILES[$i]} == $NODE_CONFIG ]]; then
107+
if [[ ${FILES[$i]} == "$NODE_CONFIG" ]]; then
108108
continue
109109
fi
110110

0 commit comments

Comments
 (0)