From ead025cbe7798169c25f4de8659a48b1538df5fe Mon Sep 17 00:00:00 2001 From: James Shubin Date: Wed, 10 Feb 2016 18:40:57 -0500 Subject: [PATCH] Path fixes to avoid overwriting each other --- misc/make-path.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/misc/make-path.sh b/misc/make-path.sh index 1dcf9480..c88c4d92 100755 --- a/misc/make-path.sh +++ b/misc/make-path.sh @@ -26,10 +26,10 @@ echo "gobin is: $GOBIN" # add gobin to $PATH if ! env | grep '^PATH=' | grep -q "$GOBIN"; then - if ! grep -q '^export PATH="'"${GOBIN}:${PATH}"'"' ~/.bashrc; then - echo 'export PATH="'"${GOBIN}"':'"${PATH}"'"' >> ~/.bashrc + if ! grep -q '^export PATH="'"${GOBIN}"':${PATH}"' ~/.bashrc; then + echo 'export PATH="'"${GOBIN}"':${PATH}"' >> ~/.bashrc fi - export PATH="${PATH}" # basically useless + export PATH="${GOBIN}:${PATH}" echo "setting path to: $PATH" fi @@ -37,10 +37,11 @@ echo "path is: $PATH" # add ~/bin/ to $PATH if ! env | grep '^PATH=' | grep -q "$HOME/bin"; then - if ! grep -q '^export PATH="'"${HOME}/bin:${PATH}"'"' ~/.bashrc; then - echo 'export PATH="'"${HOME}/bin"':'"${PATH}"'"' >> ~/.bashrc + mkdir -p "${HOME}/bin" + if ! grep -q '^export PATH="'"${HOME}/bin"':${PATH}"' ~/.bashrc; then + echo 'export PATH="'"${HOME}/bin"':${PATH}"' >> ~/.bashrc fi - export PATH="${PATH}" # basically useless + export PATH="${HOME}/bin:${PATH}" echo "setting path to: $PATH" fi