Auto adding path to installed bash, zsh and fish

This commit is contained in:
Mylloon 2021-11-14 21:13:42 +01:00
parent bcf2311377
commit 598d19ba46
2 changed files with 31 additions and 12 deletions

View file

@ -8,9 +8,5 @@ set -x MANPAGER "sh -c 'col -bx | batcat -l man -p'"
# SSH
fish_ssh_agent
# GL4Dummies
set -gx PATH $HOME/local/bin $PATH
set -gx LD_LIBRARY_PATH $HOME/local/lib $LD_LIBRARY_PATH
# Exercism
set -gx PATH ~/bin $PATH

View file

@ -15,12 +15,35 @@ rm -rf GL4Dummies
# Fix for shared libraries (https://stackoverflow.com/a/9395355)
sudo ldconfig
# changing env variables path and ld_library_path
# to correct locations to all the shell installed
# to .bashrc if exists
if [ -f $HOME/.bashrc ] ; then
echo "" >> $HOME/.bashrc
echo "# GL4Dummies" >> $HOME/.bashrc
echo "export PATH=\$PATH:\$HOME/local/bin" >> $HOME/.bashrc
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$HOME/local/lib" >> $HOME/.bashrc
echo "" >> $HOME/.bashrc
fi
# to .zshrc if exists
if [ -f $HOME/.zshrc ] ; then
echo "" >> $HOME/.zshrc
echo "# GL4Dummies" >> $HOME/.zshrc
echo "export PATH=\$PATH:\$HOME/local/bin" >> $HOME/.zshrc
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$HOME/local/lib" >> $HOME/.zshrc
echo "" >> $HOME/.zshrc
fi
# if config.fish exists
if [ -f $HOME/.config/fish/config.fish ] ; then
echo "" >> $HOME/.config/fish/config.fish
echo "# GL4Dummies" >> $HOME/.config/fish/config.fish
echo "set -gx PATH \$HOME/local/bin \$PATH" >> $HOME/.config/fish/config.fish
echo "set -gx LD_LIBRARY_PATH \$HOME/local/lib $LD_LIBRARY_PATH" >> $HOME/.config/fish/config.fish
echo "" >> $HOME/.config/fish/config.fish
fi
echo ""
echo ""
echo "Add theses lines to your ~/.bashrc"
echo "export PATH=\$PATH:\$HOME/local/bin"
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$HOME/local/lib"
echo ""
echo "If you use Fish, add theses lines to your ~/.config/fish/config.fish"
echo "set -gx PATH $HOME/local/bin $PATH"
echo "set -gx LD_LIBRARY_PATH $HOME/local/lib $LD_LIBRARY_PATH"
echo "You may need to restart your shell to apply changes."