Conversation
Auto-detect the operating system identifier from /etc/os-release, so that users do not need to specify it manually. The ibmcloud setup command applies to both RH and non-RH distros, so we don't need to check the OS there. Signed-off-by: Ken Dreyer <[email protected]>
| echo "neither system 'ID' nor 'ID_LIKE' is 'fedora' - did you mean to specify a 'rh' system?" | ||
| fi | ||
| curl -fsSL https://clis.cloud.ibm.com/install/linux | sh | ||
| } |
There was a problem hiding this comment.
seems better to add a check to make sure install success...
There was a problem hiding this comment.
Is that not handled by the exit code of the command still?
There was a problem hiding this comment.
I did some testing.
When the sh command fails, local-setup.sh will exit with a non-zero exit code.
When the curl command fails, sh eats the exit code of curl, so local-setup.sh still exits with 0. That is a problem that is not directly related to the changes I'm making in this PR. We could fix that with set -o pipefail at the top of this script.
(This type of thing is why I prefer other languages to Bash. There are so many gotchas like this with error handling. But I understand this particular script makes sense to keep in Bash for now.)
| echo "neither system 'ID' nor 'ID_LIKE' is 'fedora' - did you mean to specify a 'rh' system?" | ||
| fi | ||
| curl -fsSL https://clis.cloud.ibm.com/install/linux | sh | ||
| } |
There was a problem hiding this comment.
Is that not handled by the exit code of the command still?
Auto-detect the operating system identifier from
/etc/os-release, so that users do not need to specify it manually.The
ibmcloudsetup command applies to both RH and non-RH distros, so we don't need to check the OS there.