87 lines
2.6 KiB
Fish
Raw Normal View History

set det_os "unknown"
2015-06-05 12:16:12 -07:00
switch (uname)
case "Darwin"
set det_os "mac"
case "Linux"
set det_os "linux"
case '*'
set det_os "unknown"
end
# opt directory
__maybe_set -p PATH /opt/local/sbin
__maybe_set -p PATH /opt/local/bin
if test -e "/opt/local/lib"
set -gx --append LDFLAGS "-L/opt/local/lib"
end
if test -e "/opt/local/include"
set -gx --append CFLAGS "-I/opt/local/include"
end
2015-06-12 17:34:49 -07:00
# Set python paths
if [ $det_os = "mac" ]
2015-06-12 17:34:49 -07:00
# Fix Python path on OSX to avoid considering System extras over newer versions
2019-10-28 18:15:00 -07:00
# Local
__maybe_set -p PATH "$HOME/Library/Python/2.7/bin"
__maybe_set -p PATH "$HOME/Library/Python/3.8/bin"
__maybe_set -p PATH "$HOME/Library/Python/3.9/bin"
__maybe_set -p PATH "$HOME/Library/Python/3.10/bin"
__maybe_set -p PATH "$HOME/Library/Python/3.11/bin"
# set -gx PYTHONPATH $HOME/Library/Python/2.7/lib/python/site-packages:$PYTHONPATH
2019-10-28 18:15:00 -07:00
# Macports
__maybe_set -a PATH /opt/local/Library/Frameworks/Python.framework/Versions/Current/bin
2019-10-28 18:15:00 -07:00
# set -gx PYTHONPATH /opt/local/Library/Frameworks/Python.framework/Versions/Current/lib $PYTHONPATH
# set -gx PYTHONPATH /opt/local/Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages /Library/Python/2.7/site-packages $PYTHONPATH
2015-06-05 12:16:12 -07:00
end
2019-10-28 18:15:40 -07:00
# NPM paths
if command -q npm
2020-02-21 10:57:11 -08:00
set npm_path "$HOME/.npm/bin"
if [ ! -d "$npm_path" ]
# It's more robust to use the subshell, but far slower
set npm_path (npm bin -g 2> /dev/null)
end
__maybe_set -a PATH "$npm_path"
2019-10-28 18:15:40 -07:00
end
2021-12-14 18:06:30 -08:00
# Add luarocks paths
if command -q luarocks
eval (luarocks path | sed "s/export/set -gx/;s/=/ /")
__maybe_set -a PATH "$HOME/.luarocks/bin"
2021-12-14 18:06:30 -08:00
end
# Add rust cargo path
__maybe_set -p PATH "$HOME/.cargo/bin"
2018-08-03 19:14:41 -07:00
# Golang paths
set -gx GOPATH $HOME/workspace/go_path
__maybe_set -p PATH "$GOPATH/bin"
__maybe_set -p PATH "/usr/local/go/bin"
2015-08-26 14:29:51 -07:00
2016-02-04 10:33:08 -08:00
# Android paths
if [ $det_os = "linux" ]
set -gx ANDROID_HOME "$HOME/workspace/adt-bundle-linux/sdk"
else if [ $det_os = "mac" ]
2024-06-24 11:51:47 -07:00
set -gx ANDROID_HOME "$HOME/Library/Android/sdk"
end
__maybe_set -a PATH "$ANDROID_HOME/tools"
__maybe_set -a PATH "$ANDROID_HOME/tools/bin"
__maybe_set -a PATH "$ANDROID_HOME/platform-tools"
2024-06-24 11:51:47 -07:00
# Java paths
if type -q /usr/libexec/java_home && /usr/libexec/java_home &> /dev/null
2024-06-24 11:51:47 -07:00
set -gx JAVA_HOME (/usr/libexec/java_home)
end
2015-06-05 12:16:12 -07:00
2017-11-16 10:22:02 -08:00
# Ruby paths
2019-06-12 11:06:33 -07:00
if type -q rbenv ; and status --is-interactive
__maybe_set -a PATH "$HOME/.rbenv/shims"
2019-06-12 11:06:33 -07:00
else if [ -d "$HOME/.rvm" ]
__maybe_set -a PATH "$HOME/.rvm/bin"
2019-06-12 11:06:33 -07:00
source "$HOME/.rvm/scripts/extras/rvm.fish"
2017-11-16 10:22:02 -08:00
end
# Home paths to take final precedent
__maybe_set -p PATH "$HOME/.local/bin"
__maybe_set -p PATH "$HOME/bin"