balena-io-examples / google-iot

Google Cloud IoT integration
Apache License 2.0
15 stars 8 forks source link

Setup script fails due to TRUE command #17

Open kb2ma opened 2 years ago

kb2ma commented 2 years ago

Many gcloud commands embedded in gcp-setup.sh don't run due to constructs like this:

$GCLOUD_COMMIT && gcloud_slow [command]

where GCLOUD_COMMIT is defined as

GCLOUD_COMMIT=TRUE

Running on an Ubuntu 20.04 laptop with Bash 5.0. Example failure below.

*** GCP Project: Link to billing ***
1) -My-Billing-Account
Please select your billing account:1
scripts/gcp-setup.sh: line 86: TRUE: command not found
Billing account: 000000-000000-000000

*** GCP Project: Enable API's ***
This operation might take some minutes...
scripts/gcp-setup.sh: line 94: TRUE: command not found
scripts/gcp-setup.sh: line 95: TRUE: command not found
scripts/gcp-setup.sh: line 96: TRUE: command not found
Enabled API's: compute, pubsub and cloudiotcore

TRUE is not a command, but true is, at /usr/bin/true. At the same time, I don't understand why the gcloud command must be preceded with 'true'.