Skip to content

Commit 175f0b8

Browse files
committed
chore(util) minor usage fix and style cohesion for scripts
Properly show the usage message on: $ util/sdk.sh -S $ util/runtime.sh -R
1 parent aefb121 commit 175f0b8

File tree

6 files changed

+10
-2
lines changed

6 files changed

+10
-2
lines changed

util/runtime.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ while [[ "$1" ]]; do
111111
exit 0
112112
;;
113113
esac
114-
shift
114+
shift || true
115115
done
116116

117117
if [[ -z "$RUNTIME" ]]; then

util/runtimes/wasmer.sh

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ clean="$5"
157157

158158
if [ "$mode" = "download" ]; then
159159
download_wasmer "$target" "$version" "$arch" "$clean"
160+
160161
else
161162
build_wasmer "$target" "$version" "$arch" "$clean"
162163
fi

util/runtimes/wasmtime.sh

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ clean="$5"
142142

143143
if [ "$mode" = "download" ]; then
144144
download_wasmtime "$target" "$version" "$arch" "$clean"
145+
145146
else
146147
build_wasmtime "$target" "$version" "$arch" "$clean"
147148
fi

util/sdk.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ while [[ "$1" ]]; do
8383
exit 0
8484
;;
8585
esac
86-
shift
86+
shift || true
8787
done
8888

8989
if [[ -z "$PROXY_WASM_SDK" ]]; then

util/sdks/assemblyscript.sh

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ download_assemblyscript_sdk() {
2929
git fetch --tags
3030
git reset --hard "v$version"
3131
popd
32+
3233
else
3334
notice "cloning proxy-wasm-assemblyscript-sdk repository, version ${version}..."
3435
git clone \
@@ -50,6 +51,7 @@ build_assemblyscript_sdk() {
5051

5152
if [[ ! -d "$DIR_PROXY_WASM_ASSEMBLYSCRIPT_SDK" ]]; then
5253
download_assemblyscript_sdk $version
54+
5355
else
5456
local cur_version=$(cd $DIR_PROXY_WASM_ASSEMBLYSCRIPT_SDK && git describe --tags)
5557

@@ -97,6 +99,7 @@ clean="$3"
9799

98100
if [ "$mode" = "download" ]; then
99101
download_assemblyscript_sdk "$version" "$clean"
102+
100103
else
101104
build_assemblyscript_sdk "$version" "$clean"
102105
fi

util/setup_dev.sh

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ if [[ -d "$DIR_NGX_ECHO_MODULE" ]]; then
152152
git fetch
153153
git reset --hard origin/master
154154
popd
155+
155156
else
156157
notice "cloning the echo-nginx-module repository..."
157158
git clone https://github.com/openresty/echo-nginx-module.git $DIR_NGX_ECHO_MODULE
@@ -163,6 +164,7 @@ if [[ -d "$DIR_NGX_HEADERS_MORE_MODULE" ]]; then
163164
git fetch
164165
git reset --hard origin/master
165166
popd
167+
166168
else
167169
notice "cloning the headers-more-nginx-module repository..."
168170
git clone https://github.com/openresty/headers-more-nginx-module.git $DIR_NGX_HEADERS_MORE_MODULE
@@ -174,6 +176,7 @@ if [[ -d "$DIR_MOCKEAGAIN" ]]; then
174176
git fetch
175177
git reset --hard origin/master
176178
popd
179+
177180
else
178181
notice "cloning the mockeagain repository..."
179182
git clone https://github.com/openresty/mockeagain.git $DIR_MOCKEAGAIN

0 commit comments

Comments
 (0)