summaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2021-02-20 00:07:44 +0300
committerPatrick Williams <patrick@stwcx.xyz>2021-02-20 00:10:20 +0300
commita469a0ffe98eb48e976a23675fdb02cf7d8b75e3 (patch)
treec0be6e1d13e6053879e823dc08d6a56530d9ff33 /setup
parent36a3744b2cfd6beef9459e25d1999d5a8845b5f1 (diff)
downloadopenbmc-a469a0ffe98eb48e976a23675fdb02cf7d8b75e3.tar.xz
setup: tolerate `which` failures
If this script is sourced in a shell that has something like `set -e`, then it fails if the column program does not exist because the `which columm` fails. Make a few changes to tolerate this and not fail: - Use $(...) rather than `...`. - Use `... || true` when appropriate to allow continuance. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9008778e8aee4747faa4decff74a2fb361a206ed
Diffstat (limited to 'setup')
-rwxr-xr-xsetup4
1 files changed, 2 insertions, 2 deletions
diff --git a/setup b/setup
index 57b3ded72..db9ede6ba 100755
--- a/setup
+++ b/setup
@@ -21,10 +21,10 @@ if [ -z "$ZSH_NAME" ] && [ "$(basename -- "$0")" = "setup" ]; then
fi
# Check if 'column' command is present
-COLUMN=`which column`
+COLUMN=$(which column || true)
if [ -z "$COLUMN" ]; then
# If it is not, use 'cat'
- COLUMN=`which cat`
+ COLUMN=$(which cat)
fi
machine() {