From 9b0ef8094ad2bc8090cc894b19f710fd43389a2b Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 7 Nov 2019 12:12:31 +0000 Subject: [PATCH] Don't fail when sourcing `/etc/profile` --- bootstrap-salt.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index e12f02b..7969d4f 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -6808,14 +6808,18 @@ install_macosx_git() { } install_macosx_stable_post() { - if [ ! -f /etc/paths.d/salt ]; then - print "%s\n" "/opt/salt/bin" "/usr/local/sbin" > /etc/paths.d/salt - fi + if [ ! -f /etc/paths.d/salt ]; then + print "%s\n" "/opt/salt/bin" "/usr/local/sbin" > /etc/paths.d/salt + fi - # shellcheck disable=SC1091 - . /etc/profile + # Don'f fail because of unknown variable on the next step + set +o nounset + # shellcheck disable=SC1091 + . /etc/profile + # Revert nounset to it's previous state + set -o nounset - return 0 + return 0 } install_macosx_git_post() {