Skip to content

Commit

Permalink
chore: shellcheck suggested '-n' instead of '! -z'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Drukh committed Dec 6, 2018
1 parent ccf6db1 commit 7a199f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exitWithMsg () {
TEST_SETTINGS="";
PROJECT_SUBDIR=""

if [ ! -z "${TARGET_FILE}" ]; then
if [ -n "${TARGET_FILE}" ]; then
if [ ! -f "${PROJECT_PATH}/${PROJECT_FOLDER}/${TARGET_FILE}" ]; then
exitWithMsg "\"${PROJECT_PATH}/${PROJECT_FOLDER}/${TARGET_FILE}\" does not exist" 1
fi
Expand All @@ -59,7 +59,7 @@ if [ ! -z "${TARGET_FILE}" ]; then
TEST_SETTINGS="--file=${MANIFEST_NAME} "
fi

if [ ! -z "${ORGANIZATION}" ]; then
if [ -n "${ORGANIZATION}" ]; then
TEST_SETTINGS="${TEST_SETTINGS} --org=${ORGANIZATION}"
fi

Expand All @@ -73,7 +73,7 @@ if [ -z "${SNYK_TOKEN}" ]; then
exitWithMsg "Missing \${SNYK_TOKEN}" 1
fi

if [ ! -z "${ENV_FLAGS}" ]; then
if [ -n "${ENV_FLAGS}" ]; then
ADDITIONAL_ENV="-- ${ENV_FLAGS}"
fi

Expand All @@ -93,10 +93,10 @@ fi
#
# - `GENERATE_REPORT` - [OPTIONAL] if set, this will generate the HTML report with a summary of the vulnerabilities detected by snyk.
#
# if [ ! -z $GENERATE_REPORT ]; then
# if [ -n $GENERATE_REPORT ]; then
runCmdAsDockerUser "touch \"${PROJECT_PATH}/${PROJECT_FOLDER}/${HTML_FILE}\""

if [ ! -z "$MONITOR" ]; then
if [ -n "$MONITOR" ]; then
runCmdAsDockerUser "PATH=${PATH} snyk monitor --json ${SNYK_PARAMS} ${ADDITIONAL_ENV} | jq -r \".uri\" | awk '{print \"<center><a target=\\\"_blank\\\" href=\\\"\" \$0 \"\\\">View On Snyk.io</a></center>\"}' > \"${PROJECT_PATH}/${PROJECT_FOLDER}/${HTML_FILE}\" 2>\"${ERROR_FILE}\""
fi

Expand Down

0 comments on commit 7a199f0

Please sign in to comment.