summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2022-01-24 15:41:57 +0100
committerMarc Cornellà <hello@mcornella.com>2022-01-24 15:42:10 +0100
commit861805b64d4014550808d2db176fa99bc729eebf (patch)
tree4b32a5d04bf5d202c541076b97adef68f9c8015b /tools
parentc7221c5f257fc42ec8f6c6a6463bc8a5da25b00f (diff)
downloadzsh-861805b64d4014550808d2db176fa99bc729eebf.tar.gz
zsh-861805b64d4014550808d2db176fa99bc729eebf.tar.bz2
zsh-861805b64d4014550808d2db176fa99bc729eebf.zip
fix(installer): define `$USER` if not defined
Fixes missing $USER value in ArchLinux sh (bash)
Diffstat (limited to 'tools')
-rwxr-xr-xtools/install.sh3
1 files changed, 3 insertions, 0 deletions
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