mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2025-05-24 19:14:39 +02:00
[shell/paths] replace set_path with appendpath from bash config
This commit is contained in:
parent
3acf1bcf93
commit
e6cf5963a6
1 changed files with 16 additions and 10 deletions
|
@ -1,20 +1,26 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
function set_path(){
|
# Append our default paths
|
||||||
if [[ -d "$1" ]]; then
|
appendpath () {
|
||||||
export PATH=$1:$PATH
|
case ":$PATH:" in
|
||||||
fi
|
*:"$1":*)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [[ -d "$1" ]]; then
|
||||||
|
export PATH="${PATH:+$PATH:}$1"
|
||||||
|
fi
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
set_path ~/.local/bin/
|
appendpath ~/.local/bin/
|
||||||
set_path ~/.bin
|
appendpath ~/.bin
|
||||||
|
|
||||||
if which ruby >/dev/null 2>&1 && which gem >/dev/null 2>&1; then
|
if which ruby >/dev/null 2>&1 && which gem >/dev/null 2>&1; then
|
||||||
set_path $(ruby -r rubygems -e 'puts Gem.user_dir')/bin
|
appendpath $(ruby -r rubygems -e 'puts Gem.user_dir')/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# PERL cpan modules
|
# PERL cpan modules
|
||||||
set_path $HOME/.perl/5/bin
|
appendpath $HOME/.perl/5/bin
|
||||||
export PERL5LIB="$HOME/.perl/5/lib/perl5:$PERL5LIB"
|
export PERL5LIB="$HOME/.perl/5/lib/perl5:$PERL5LIB"
|
||||||
export PERL_LOCAL_LIB_ROOT="$HOME/.perl/5:$PERL_LOCAL_LIB_ROOT"
|
export PERL_LOCAL_LIB_ROOT="$HOME/.perl/5:$PERL_LOCAL_LIB_ROOT"
|
||||||
export PERL_MB_OPT="--install_base \"$HOME/.perl/5\""
|
export PERL_MB_OPT="--install_base \"$HOME/.perl/5\""
|
||||||
|
@ -22,5 +28,5 @@ export PERL_MM_OPT="INSTALL_BASE=$HOME/.perl/5"
|
||||||
|
|
||||||
export GOPATH=$HOME/.go
|
export GOPATH=$HOME/.go
|
||||||
export GOBIN=$HOME/.gobin
|
export GOBIN=$HOME/.gobin
|
||||||
set_path $GOPATH/bin
|
appendpath $GOPATH/bin
|
||||||
set_path $GOBIN
|
appendpath $GOBIN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue