Skip to content

Commit a10c676

Browse files
committed
Use explicit -n
1 parent 86c1f89 commit a10c676

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scripts/tests/ai/decrypt_secrets.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Expects the environment variable "secrets_passphrase" to be set.
2323
# This should be set to gpg password for encrypting/decrypting the files.
2424

25-
if [[ ! "${secrets_passphrase}" ]]; then
25+
if [[ -n "${secrets_passphrase}" ]]; then
2626
echo "Missing environment variable (secrets_passphrase) to decrypt the files with."
2727
exit 1
2828
fi

scripts/tests/ai/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ set -eo pipefail
4848
xcode=$1
4949

5050
# Look for Xcode installations if a version wasn't provided explicitly
51-
if [[ ! "${xcode}" ]]; then
51+
if [[ -n "${xcode}" ]]; then
5252
apps=(/Applications/Xcode*.app)
5353
names=()
5454
for p in "${apps[@]}"; do
@@ -79,7 +79,7 @@ if [[ $# -gt 1 ]]; then
7979
target="$2"
8080
fi
8181

82-
if [[ ! "${TEST_RUNNER_FIRAAppCheckDebugToken}" ]]; then
82+
if [[ -n "${TEST_RUNNER_FIRAAppCheckDebugToken}" ]]; then
8383
echo "Missing required environment variable for app check debug token (TEST_RUNNER_FIRAAppCheckDebugToken)"
8484
exit 1
8585
fi
@@ -103,7 +103,7 @@ check_for_secret_files () {
103103

104104
cleanup () {
105105
# We only delete the decrypted secret files if we were the ones to decrypt them.
106-
if [[ "${delete_secrets}" ]]; then
106+
if [[ -n "${delete_secrets}" ]]; then
107107
echo "Removing secret files"
108108
for file in "${secret_files[@]}"; do
109109
rm -f "${file}"
@@ -116,7 +116,7 @@ cleanup () {
116116
trap 'exit_code=$?; cleanup; exit "$exit_code"' ERR
117117
trap 'cleanup' EXIT
118118

119-
if [[ ! "${secrets_passphrase}" ]]; then
119+
if [[ -n "${secrets_passphrase}" ]]; then
120120
echo "Environment variable 'secrets_passphrase' wasn't set. Checking if files are already present"
121121
check_for_secret_files
122122
echo "Files are present, moving forward"

0 commit comments

Comments
 (0)