[zsh] add global Yarn packages to PATH

This commit is contained in:
Dmytro Meleshko 2019-10-06 13:24:46 +03:00
parent 4ed961d434
commit 355b3ea091
1 changed files with 19 additions and 1 deletions

View File

@ -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[@]}")