From e060f86b9aec1e31412312aa74c32076723029de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=A4der?= Date: Tue, 15 Oct 2019 10:03:39 +0200 Subject: [PATCH] Corrections for shellcheck warnings --- build-latest.sh | 2 +- build.sh | 15 ++++++--------- hooks/build | 1 + 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/build-latest.sh b/build-latest.sh index 4dea605..31a0f76 100755 --- a/build-latest.sh +++ b/build-latest.sh @@ -19,7 +19,7 @@ fi # Checking if PRERELEASE is either unset, 'true' or 'false' ### if [ -n "${PRERELEASE}" ] && - { [ "${PRERELEASE}" != "true" ] && [ "${PRERELEAS}E" != "false" ]; }; then + { [ "${PRERELEASE}" != "true" ] && [ "${PRERELEASE}" != "false" ]; }; then if [ -z "${DEBUG}" ]; then echo "⚠️ PRERELEASE must be either unset, 'true' or 'false', but was '${PRERELEASE}'!" diff --git a/build.sh b/build.sh index a268669..123cd17 100755 --- a/build.sh +++ b/build.sh @@ -222,22 +222,19 @@ for DOCKER_TARGET in "${DOCKER_TARGETS[@]}"; do # --label DOCKER_BUILD_ARGS+=( - --label "NETBOX_DOCKER_PROJECT_VERSION=${NETBOX_DOCKER_PROJECT_VERSION}" - --label "NETBOX_BRANCH=${BRANCH}" - --label "ORIGINAL_DOCKER_TAG=${TARGET_DOCKER_TAG}" + --label "NETBOX_DOCKER_PROJECT_VERSION=${NETBOX_DOCKER_PROJECT_VERSION}" + --label "NETBOX_BRANCH=${BRANCH}" + --label "ORIGINAL_DOCKER_TAG=${TARGET_DOCKER_TAG}" ) if [ -d "${NETBOX_PATH}/.git" ]; then DOCKER_BUILD_ARGS+=( - --label "NETBOX_GIT_COMMIT=$($DRY cd ${NETBOX_PATH}; $DRY git rev-parse HEAD)" - --label "NETBOX_GIT_URL=$($DRY cd ${NETBOX_PATH}; $DRY git remote get-url origin)" + --label "NETBOX_GIT_COMMIT=$($DRY cd "${NETBOX_PATH}"; $DRY git rev-parse HEAD)" + --label "NETBOX_GIT_URL=$($DRY cd "${NETBOX_PATH}"; $DRY git remote get-url origin)" ) fi # --build-arg - DOCKER_BUILD_ARGS+=( - --build-arg "NETBOX_PATH=${NETBOX_PATH}" - --build-arg "DOCKER_REPO=${DOCKER_REPO}" - ) + DOCKER_BUILD_ARGS+=( --build-arg "NETBOX_PATH=${NETBOX_PATH}" ) if [ -n "${DOCKER_FROM}" ]; then DOCKER_BUILD_ARGS+=( --build-arg "FROM=${DOCKER_FROM}" ) fi diff --git a/hooks/build b/hooks/build index 85bad75..80c4165 100755 --- a/hooks/build +++ b/hooks/build @@ -2,4 +2,5 @@ . hooks/common +# shellcheck disable=SC2119 run_build