Skip to content

Commit

Permalink
use test -n instead of ! test -z
Browse files Browse the repository at this point in the history
`test -n` is the inverse of `test -z`

Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
  • Loading branch information
bacongobbler committed Mar 2, 2022
1 parent a0146a6 commit 9207867
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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

Expand Down

0 comments on commit 9207867

Please sign in to comment.