From 56c1ad6d87c18c68d174ec71cc973d0749764a1a Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sun, 30 Jun 2024 16:31:40 -0700 Subject: [PATCH] Cleanup root detection logic --- bin/wally-tool-chain-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 3ba192249..f41b896d1 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -92,11 +92,11 @@ else fi # Check if root -ROOT=$( [ "${EUID:=$(id -u)}" = 0 ] && echo true || echo false); +ROOT=$( [ "${EUID:=$(id -u)}" = 0 ] && echo true) # All tools will be installed under the $RISCV directory. By default, if run as root (with sudo) this is set to # /opt/riscv. Otherwise, it is set to ~/riscv. This value can be overridden with an argument passed to the script. -if [ "$ROOT" = true ]; then +if [ "$ROOT" ]; then export RISCV="${1:-/opt/riscv}" else export RISCV="${1:-$HOME/riscv}"