Path fixes to avoid overwriting each other

This commit is contained in:
James Shubin
2016-02-10 18:40:57 -05:00
parent 83caea1bdc
commit ead025cbe7

View File

@@ -26,10 +26,10 @@ echo "gobin is: $GOBIN"
# add gobin to $PATH # add gobin to $PATH
if ! env | grep '^PATH=' | grep -q "$GOBIN"; then if ! env | grep '^PATH=' | grep -q "$GOBIN"; then
if ! grep -q '^export PATH="'"${GOBIN}:${PATH}"'"' ~/.bashrc; then if ! grep -q '^export PATH="'"${GOBIN}"':${PATH}"' ~/.bashrc; then
echo 'export PATH="'"${GOBIN}"':'"${PATH}"'"' >> ~/.bashrc echo 'export PATH="'"${GOBIN}"':${PATH}"' >> ~/.bashrc
fi fi
export PATH="${PATH}" # basically useless export PATH="${GOBIN}:${PATH}"
echo "setting path to: $PATH" echo "setting path to: $PATH"
fi fi
@@ -37,10 +37,11 @@ echo "path is: $PATH"
# add ~/bin/ to $PATH # add ~/bin/ to $PATH
if ! env | grep '^PATH=' | grep -q "$HOME/bin"; then if ! env | grep '^PATH=' | grep -q "$HOME/bin"; then
if ! grep -q '^export PATH="'"${HOME}/bin:${PATH}"'"' ~/.bashrc; then mkdir -p "${HOME}/bin"
echo 'export PATH="'"${HOME}/bin"':'"${PATH}"'"' >> ~/.bashrc if ! grep -q '^export PATH="'"${HOME}/bin"':${PATH}"' ~/.bashrc; then
echo 'export PATH="'"${HOME}/bin"':${PATH}"' >> ~/.bashrc
fi fi
export PATH="${PATH}" # basically useless export PATH="${HOME}/bin:${PATH}"
echo "setting path to: $PATH" echo "setting path to: $PATH"
fi fi