Merge two similar if-clauses into one.

Hope readability does not suffer too much.

Add best practice doublequotes around $() expansions (although we are pretty safe here)
This commit is contained in:
Jürgen Weigert
2025-07-01 14:54:59 +02:00
parent 88e458c34a
commit 02d793169d

View File

@@ -58,18 +58,15 @@ mkdir ${sandbox} && cd ${sandbox}
# The operating system
os="linux"
if [[ $OSTYPE == 'darwin'* ]]; then
if [[ "$OSTYPE" == 'darwin'* ]]; then
os="darwin"
fi
# The platform
dlarch="amd64"
if [[ $(uname -s) == "Darwin" && $(uname -m) == "arm64" ]]; then
dlarch="arm64"
fi
if [[ $(uname -s) == "Linux" && $(uname -m) == "aarch64" ]]; then
if [[ ( "$(uname -s)" == "Darwin" && "$(uname -m)" == "arm64" ) ||
( "$(uname -s)" == "Linux" && "$(uname -m)" == "aarch64" ) ]]; then
dlarch="arm64"
fi