Merge pull request #111 from corvus-ch/preserve_system_path

Preserve system PATH
This commit is contained in:
KM4ACK 2024-11-10 11:38:35 -06:00 committed by GitHub
commit 9271a7554d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -300,9 +300,11 @@ EOF
#setup bin dir and put in path
mkdir -p ${HOME}/bin
CK=$(grep $HOME/bin $HOME/.bashrc)
if [ -z "$CK" ]; then
echo "export PATH=$PATH:${HOME}/bin" >>${HOME}/.bashrc
# Add $HOME/bin to PATH
# Prevent adding it more than once
# Prevent adding it if already added elswhere
if ! grep -q 'export PATH=$PATH:$HOME/bin' "${HOME}/.bashrc" && [[ ! "${PATH}" =~ "${HOME}/bin" ]]; then
echo 'export PATH=$PATH:$HOME/bin' >> "${HOME}/.bashrc"
fi
##################################