bin/web: Fix shellcheck issues (#4425)

Signed-off-by: Joakim Roubert <joakimr@axis.com>
This commit is contained in:
Joakim Roubert 2020-05-18 19:46:28 +02:00 committed by GitHub
parent 9c639dc3b7
commit 55326a61ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -110,7 +110,6 @@ jobs:
! -name test-run \ ! -name test-run \
! -name _test-run.sh \ ! -name _test-run.sh \
! -name update-go-deps-shas \ ! -name update-go-deps-shas \
! -name web \
! -name *.nuspec \ ! -name *.nuspec \
! -name *.ps1 \ ! -name *.ps1 \
| xargs -I {} bin/shellcheck -x {} | xargs -I {} bin/shellcheck -x {}

21
bin/web
View File

@ -24,7 +24,7 @@ USAGE: web <command>
* test - run the unit tests * test - run the unit tests
Note: any command line options are passed on to the test runner (jest) Note: any command line options are passed on to the test runner (jest)
USAGE USAGE
}; function --help { -h ;} }; function --help { '-h' ;}
check-for-linkerd() { check-for-linkerd() {
controller_pod=$(get-pod controller) controller_pod=$(get-pod controller)
@ -44,12 +44,13 @@ check-for-linkerd() {
dev() { dev() {
while getopts "p:" opt; do while getopts "p:" opt; do
case "$opt" in case "$opt" in
p) DEV_PORT=$OPTARG p) DEV_PORT=$OPTARG;;
*) ;;
esac esac
done done
cd "$ROOT"/web/app && yarn webpack-dev-server --port $DEV_PORT & cd "$ROOT"/web/app && yarn webpack-dev-server --port "$DEV_PORT" &
run run ''
} }
build() { build() {
@ -64,7 +65,7 @@ get-pod() {
fi fi
kubectl --namespace=linkerd get po \ kubectl --namespace=linkerd get po \
--selector=linkerd.io/control-plane-component=$1 \ --selector=linkerd.io/control-plane-component="$1" \
--field-selector='status.phase==Running' \ --field-selector='status.phase==Running' \
-o jsonpath='{.items[*].metadata.name}' -o jsonpath='{.items[*].metadata.name}'
} }
@ -76,7 +77,7 @@ port-forward() {
fi fi
nc -z localhost "$2" || \ nc -z localhost "$2" || \
kubectl --namespace=linkerd port-forward $(get-pod $1) "$2:$2" kubectl --namespace=linkerd port-forward "$(get-pod "$1")" "$2:$2"
} }
run() { run() {
@ -93,17 +94,17 @@ run() {
) )
cd "$ROOT"/web && \ cd "$ROOT"/web && \
../bin/go-run . --addr=:7777 $* ../bin/go-run . --addr=:7777 "$@"
} }
setup() { setup() {
cd "$ROOT"/web/app cd "$ROOT"/web/app
yarn $* yarn "$@"
} }
function test { function test {
cd "$ROOT"/web/app cd "$ROOT"/web/app
yarn jest $* yarn jest "$@"
} }
integration() { integration() {
@ -121,7 +122,7 @@ integration() {
} }
main() { main() {
setup setup ''
build build
} }