mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[zsh] add global Yarn packages to PATH
This commit is contained in:
parent
4ed961d434
commit
355b3ea091
1 changed files with 19 additions and 1 deletions
20
zsh/path.zsh
20
zsh/path.zsh
|
@ -9,6 +9,21 @@ typeset -T PKG_CONFIG_PATH pkg_config_path ':'
|
|||
typeset -U path fpath manpath ldflags cppflags pkg_config_path
|
||||
export -U PATH FPATH MANPATH LDFLAGS CPPFLAGS PKG_CONFIG_PATH
|
||||
|
||||
path_append() {
|
||||
local arr_name="$1" value="$2"
|
||||
if eval "if (( \${${arr_name}[(ie)\$value]} > \${#${arr_name}} ))"; then
|
||||
eval "${arr_name}+=(\"\$value\")"
|
||||
eval "${arr_name}=(\"\${${arr_name}[@]}\" \"\$value\")"
|
||||
fi
|
||||
}
|
||||
|
||||
path_prepend() {
|
||||
local arr_name="$1" value="$2"
|
||||
if eval "if (( \${${arr_name}[(ie)\$value]} > \${#${arr_name}} ))"; then
|
||||
eval "${arr_name}=(\"\$value\" \"\${${arr_name}[@]}\")"
|
||||
fi
|
||||
}
|
||||
|
||||
if is_macos; then
|
||||
path=(
|
||||
~/Library/Python/*/bin
|
||||
|
@ -39,7 +54,10 @@ if is_macos; then
|
|||
done
|
||||
fi
|
||||
|
||||
# add Go binaries
|
||||
# Yarn global packages
|
||||
path=(~/.yarn/bin "${path[@]}")
|
||||
|
||||
# Go
|
||||
export GOPATH=~/.go
|
||||
path=("$GOPATH/bin" "${path[@]}")
|
||||
|
||||
|
|
Loading…
Reference in a new issue