dotfiles/lib/path.zsh

42 lines
1.1 KiB
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
# path to libraries installed with Homebrew
arr_push LIBRARY_PATH "/usr/local/lib"
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"
2018-10-11 20:38:05 +00:00
# Rust
if command_exists rustc; then
rust_sysroot="$(rustc --print sysroot)"
arr_push FPATH "${rust_sysroot}/share/zsh/site-functions"
arr_push MANPATH "${rust_sysroot}/share/man"
unset rust_sysroot
fi
2018-09-09 12:15:20 +00:00
unset arr_push