Skip to content

Commit

Permalink
Don't use -z in Bash scripts with -u set
Browse files Browse the repository at this point in the history
  • Loading branch information
duncancmt committed Aug 5, 2024
1 parent 202802f commit 3fcbd7c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sh/checkout_settler_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ declare rpc_url
rpc_url="$(get_api_secret rpcUrl)"
declare -r rpc_url

if [[ -z $rpc_url ]] ; then
if [[ ${rpc_url:-unset} = 'unset' ]] ; then
echo '`rpcUrl` is unset in `api_secrets.json` for chain "'"$chain_name"'"' >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion sh/common_safe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ ${rpc_url:-unset} = 'unset' ]] ; then
rpc_url="$(get_api_secret rpcUrl)"
declare -r rpc_url
fi
if [[ -z $rpc_url ]] ; then
if [[ ${rpc_url:-unset} = 'unset' ]] ; then
echo '`rpcUrl` is unset in `api_secrets.json` for chain "'"$chain_name"'"' >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion sh/deploy_allowanceholder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cd "$project_root"
declare rpc_url
rpc_url="$(get_api_secret rpcUrl)"
declare -r rpc_url
if [[ -z $rpc_url ]] ; then
if [[ ${rpc_url:-unset} = 'unset' ]] ; then
echo '`rpcUrl` is unset in `api_secrets.json` for chain "'"$chain_name"'"' >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion sh/deploy_new_chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ declare rpc_url
rpc_url="$(get_api_secret rpcUrl)"
declare -r rpc_url

if [[ -z $rpc_url ]] ; then
if [[ ${rpc_url:-unset} = 'unset' ]] ; then
echo '`rpcUrl` is unset in `api_secrets.json` for chain "'"$chain_name"'"' >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion sh/deploy_safe_infra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ declare rpc_url
rpc_url="$(get_api_secret rpcUrl)"
declare -r rpc_url

if [[ -z $rpc_url ]] ; then
if [[ ${rpc_url:-unset} = 'unset' ]] ; then
echo '`rpcUrl` is unset in `api_secrets.json` for chain "'"$chain_name"'"' >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion sh/verify_settler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ declare -r -i chainid
declare rpc_url
rpc_url="$(get_api_secret rpcUrl)"
declare -r rpc_url
if [[ -z $rpc_url ]] ; then
if [[ ${rpc_url:-unset} = 'unset' ]] ; then
echo '`rpcUrl` is unset in `api_secrets.json` for chain "'"$chain_name"'"' >&2
exit 1
fi
Expand Down

0 comments on commit 3fcbd7c

Please sign in to comment.