From 920786785ef0030b76b3146723a35f0bb95c3828 Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Wed, 2 Mar 2022 09:44:52 -0800 Subject: [PATCH] use `test -n` instead of `! test -z` `test -n` is the inverse of `test -z` Signed-off-by: Matthew Fisher --- entrypoint.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 940ebd7..ed818fb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,22 +2,22 @@ set -e -if [ -z "$INPUT_SOURCE_DIR" ]; then +if [[ -z "$INPUT_SOURCE_DIR" ]]; then echo "source directory is not set. Quitting." exit 1 fi -if [ -z "$INPUT_CONTAINER_NAME" ]; then +if [[ -z "$INPUT_CONTAINER_NAME" ]]; then echo "storage account container name is not set. Quitting." exit 1 fi CONNECTION_METHOD="" -if ! [ -z "$INPUT_CONNECTION_STRING" ]; then +if [[ -n "$INPUT_CONNECTION_STRING" ]; then CONNECTION_METHOD="--connection-string $INPUT_CONNECTION_STRING" -elif ! [ -z "$INPUT_SAS_TOKEN" ]; then - if ! [ -z "$INPUT_ACCOUNT_NAME" ]; then +elif [[ -n "$INPUT_SAS_TOKEN" ]]; then + if [[ -n "$INPUT_ACCOUNT_NAME" ]]; then CONNECTION_METHOD="--sas-token $INPUT_SAS_TOKEN --account-name $INPUT_ACCOUNT_NAME" else echo "account_name is required if using a sas_token. account_name is not set. Quitting." @@ -29,24 +29,24 @@ else fi ARG_OVERWRITE="" -if ! [[ -z ${INPUT_OVERWRITE} ]]; then +if [[ -n ${INPUT_OVERWRITE} ]]; then ARG_OVERWRITE="--overwrite true" fi EXTRA_ARGS="" -if ! [[ -z ${INPUT_EXTRA_ARGS} ]]; then +if [[ -n ${INPUT_EXTRA_ARGS} ]]; then EXTRA_ARGS=${INPUT_EXTRA_ARGS} fi VERB="upload-batch" CONTAINER_NAME_FLAG="--destination" -if ! [[ -z ${INPUT_SYNC} ]]; then +if [[ -n ${INPUT_SYNC} ]]; then VERB="sync" CONTAINER_NAME_FLAG="--container" fi CLI_VERSION="" -if ! [[ -z ${INPUT_CLI_VERSION} ]]; then +if [[ -n ${INPUT_CLI_VERSION} ]]; then CLI_VERSION="==${INPUT_CLI_VERSION}" fi