From 861805b64d4014550808d2db176fa99bc729eebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 24 Jan 2022 15:41:57 +0100 Subject: [PATCH] fix(installer): define `$USER` if not defined Fixes missing $USER value in ArchLinux sh (bash) --- tools/install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/install.sh b/tools/install.sh index b4b90a62d..9ad6f7d14 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -51,6 +51,9 @@ CHSH=${CHSH:-yes} RUNZSH=${RUNZSH:-yes} KEEP_ZSHRC=${KEEP_ZSHRC:-no} +# Sane defaults +USER=${USER:-$(whoami)} + command_exists() { command -v "$@" >/dev/null 2>&1