dotfiles/lib/path.zsh

32 lines
913 B
Bash
Raw Normal View History

2018-06-15 13:43:04 +00:00
#!/usr/bin/env zsh
2018-02-23 09:38:24 +00:00
2018-09-09 12:15:20 +00:00
arr_push() { eval "export $1=\"$2:\$$1\""; }
2018-02-23 09:38:24 +00:00
# user binaries
2018-09-09 12:15:20 +00:00
arr_push PATH "$HOME/bin"
arr_push PATH "$HOME/.local/bin"
2018-06-10 19:28:54 +00:00
# Rust binaries
2018-09-09 12:15:20 +00:00
arr_push PATH "$HOME/.cargo/bin"
2018-02-23 09:38:24 +00:00
# global Yarn packages
2018-09-09 12:15:20 +00:00
arr_push PATH "$HOME/.config/yarn/global/node_modules/.bin"
2018-02-23 09:38:24 +00:00
if is_macos; then
2018-09-09 12:15:20 +00:00
# Haskell packages
arr_push PATH "$HOME/Library/Haskell/bin"
2018-02-23 09:38:24 +00:00
# GNU sed
2018-09-09 12:15:20 +00:00
arr_push PATH "/usr/local/opt/gnu-tar/libexec/gnubin"
arr_push MANPATH "/usr/local/opt/gnu-tar/libexec/gnuman"
2018-02-23 09:38:24 +00:00
# GNU tar
2018-09-09 12:15:20 +00:00
arr_push PATH "/usr/local/opt/gnu-sed/libexec/gnubin"
arr_push MANPATH "/usr/local/opt/gnu-sed/libexec/gnuman"
2018-02-23 09:38:24 +00:00
# GNU coreutils
2018-09-09 12:15:20 +00:00
arr_push PATH "/usr/local/opt/coreutils/libexec/gnubin"
arr_push MANPATH "/usr/local/opt/coreutils/libexec/gnuman"
2018-02-23 09:38:24 +00:00
fi
2018-09-09 12:15:20 +00:00
arr_push FPATH "$DOTFILES_PATH/completions"
command_exists rustc && arr_push FPATH "$(rustc --print sysroot)/share/zsh/site-functions"
unset arr_push