From 792da139c981620056a4ab1b930b60537bd0d447 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Tue, 28 Apr 2020 07:26:29 +0000 Subject: [PATCH] move homebrew to the end (#789) --- images/linux/scripts/helpers/etc-environment.sh | 5 +++++ images/linux/scripts/installers/homebrew.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/images/linux/scripts/helpers/etc-environment.sh b/images/linux/scripts/helpers/etc-environment.sh index f0a68cf40..9637f242e 100644 --- a/images/linux/scripts/helpers/etc-environment.sh +++ b/images/linux/scripts/helpers/etc-environment.sh @@ -61,6 +61,11 @@ function prependEtcEnvironmentPath { prependEtcEnvironmentVariable PATH "${element}" } +function appendEtcEnvironmentPath { + element="$1" + appendEtcEnvironmentVariable PATH "${element}" +} + # Process /etc/environment as if it were shell script with `export VAR=...` expressions # The PATH variable is handled specially in order to do not override the existing PATH # variable. The value of PATH variable read from /etc/environment is added to the end diff --git a/images/linux/scripts/installers/homebrew.sh b/images/linux/scripts/installers/homebrew.sh index 17622f5cb..ee94ea602 100644 --- a/images/linux/scripts/installers/homebrew.sh +++ b/images/linux/scripts/installers/homebrew.sh @@ -20,7 +20,7 @@ sudo chmod -R o+w $HOMEBREW_PREFIX brew shellenv|grep 'export HOMEBREW'|sed -E 's/^export (.*);$/\1/' | sudo tee -a /etc/environment # add brew executables locations to PATH brew_path=$(brew shellenv|grep '^export PATH' |sed -E 's/^export PATH="([^$]+)\$.*/\1/') -prependEtcEnvironmentPath "$brew_path" +appendEtcEnvironmentPath "$brew_path" # Validate the installation ad hoc echo "Validate the installation reloading /etc/environment"