From 9f904eb27ef8b1dc151899ff8096e5a496b141b9 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Mon, 3 Feb 2020 18:25:53 +1100 Subject: [PATCH] [MISC] Make bootstrap.sh OSX friendly (#613) Fixes #610. --- bootstrap.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 7fc4f6e2c..f39d7f1f9 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -2,33 +2,39 @@ export PATH=$PATH:./cmd/authelia-scripts/:./node_modules/.bin:/tmp -if [ -z "$OLD_PS1" ]; then +if [[ -z "$OLD_PS1" ]]; then OLD_PS1="$PS1" export PS1="(authelia) $PS1" fi -if [ $(id -u) = 0 ]; then +if [[ $(id -u) = 0 ]]; then echo "Cannot run as root, defaulting to UID 1000" export USER_ID=1000 +elif [[ $(uname) == "Darwin" ]]; then + echo "Normalise for OSX, defaulting to UID 1000" + export USER_ID=1000 else export USER_ID=$(id -u) fi -if [ $(id -g) = 0 ]; then +if [[ $(id -g) = 0 ]]; then echo "Cannot run as root, defaulting to GID 1000" export GROUP_ID=1000 +elif [[ $(uname) == "Darwin" ]]; then + echo "Normalise for OSX, defaulting to GID 1000" + export GROUP_ID=1000 else export GROUP_ID=$(id -g) fi -if [ "$CI" == "true" ]; then +if [[ "$CI" == "true" ]]; then true else export CI=false fi echo "[BOOTSTRAP] Checking if Go is installed..." -if [ ! -x "$(command -v go)" ]; +if [[ ! -x "$(command -v go)" ]]; then echo "[ERROR] You must install Go on your machine."; return