From d8736a5795d7dab50cfd7083570ba0e7c5fa0ab1 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 17:29:44 +0200 Subject: [PATCH] Improve shell syntax ShellCheck syntax errors SC2006, SC2162, SC2086 --- hooks/build | 8 ++++---- hooks/push | 4 ++-- hooks/test | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hooks/build b/hooks/build index d979609..335c540 100755 --- a/hooks/build +++ b/hooks/build @@ -2,10 +2,10 @@ set -e -while read docker_version compose_version; +while read -r docker_version compose_version; do docker build \ - --build-arg DOCKER_VERSION=${docker_version} \ - --build-arg COMPOSE_VERSION=${compose_version} \ - -t $DOCKER_REPO:${docker_version} . + --build-arg DOCKER_VERSION="${docker_version}" \ + --build-arg COMPOSE_VERSION="${compose_version}" \ + -t "${DOCKER_REPO}:${docker_version}" . done < DOCKER_AND_COMPOSE_VERSION_MATRIX diff --git a/hooks/push b/hooks/push index c7a50bb..239b2a0 100755 --- a/hooks/push +++ b/hooks/push @@ -2,9 +2,9 @@ set -e -images=`docker image ls ${DOCKER_REPO} --format "{{.Repository}}:{{.Tag}}"`; +images=$(docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}"); for image in ${images}; do - docker image push ${image} + docker image push "${image}" done diff --git a/hooks/test b/hooks/test index 64c81a3..942cae4 100755 --- a/hooks/test +++ b/hooks/test @@ -2,7 +2,7 @@ set -e -images=`docker image ls ${DOCKER_REPO} --format "{{.Repository}}:{{.Tag}}"`; +images=$(docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}"); for image in ${images}; do