-
Notifications
You must be signed in to change notification settings - Fork 2
/
dot_profile
36 lines (31 loc) · 1.11 KB
/
dot_profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# export MANPATH="$NPM_PACKAGES/share/man:$MANPATH"
# export EDITOR=vi
# export PAGER=nvimpager
pathadd() {
newelement=${1%/}
if [ -d "$1" ] && ! echo "$PATH" | grep -E -q "(^|:)$newelement($|:)" ; then
if [ "$2" = "after" ] ; then
PATH="$PATH:$newelement"
else
PATH="$newelement:$PATH"
fi
fi
}
pathrm() {
PATH="$(echo -n "$PATH" | sed -e "s;\(^\|:\)${1%/}\(:\|\$\);\1\2;g" -e 's;^:\|:$;;g' -e 's;::;:;g')"
}
export MYPATH="${MYPATH:-$HOME/.bin}"
export CABALPATH="${CABALPATH:-$HOME/.cabal}"
export CARGOPATH="${CARGOPATH:-$HOME/.cargo}"
export LOCALPATH="${LOCALPATH:-$HOME/.local/bin}"
export GOPATH="${GOPATH:-$HOME/Local/go}"
export NODE_PATH="${NODE_PATH:-$HOME/.node}"
if which ruby >/dev/null && which gem >/dev/null; then
RUBYREMPATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin"
fi
declare -a PATH_TO_ADD=( "$RUBYREMPATH" "$NODE_PATH/node_modules/.bin" "$GOPATH/bin" "$CARGOPATH/bin" "$CABALPATH/bin" "$LOCALPATH" "$MYPATH" )
for p in "${PATH_TO_ADD[@]}"; do
pathadd "$p"
done
export PATH
[[ -f ~/.ssh/wsl-agent.sh ]] && source ~/.ssh/wsl-agent.sh