mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 07:20:40 +01:00
feat(yarn): add setting to disable adding global dir to $PATH (#10642)
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
# Skip yarn call if default global bin dir exists
|
||||
[[ -d "$HOME/.yarn/bin" ]] && bindir="$HOME/.yarn/bin" || bindir="$(yarn global bin 2>/dev/null)"
|
||||
if zstyle -T ':omz:plugins:yarn' global-path; then
|
||||
# Skip yarn call if default global bin dir exists
|
||||
[[ -d "$HOME/.yarn/bin" ]] && bindir="$HOME/.yarn/bin" || bindir="$(yarn global bin 2>/dev/null)"
|
||||
|
||||
# Add yarn bin directory to $PATH if it exists and not already in $PATH
|
||||
[[ $? -eq 0 ]] \
|
||||
&& [[ -d "$bindir" ]] \
|
||||
&& (( ! ${path[(Ie)$bindir]} )) \
|
||||
&& path+=("$bindir")
|
||||
unset bindir
|
||||
# Add yarn bin directory to $PATH if it exists and not already in $PATH
|
||||
[[ $? -eq 0 ]] \
|
||||
&& [[ -d "$bindir" ]] \
|
||||
&& (( ! ${path[(Ie)$bindir]} )) \
|
||||
&& path+=("$bindir")
|
||||
unset bindir
|
||||
fi
|
||||
|
||||
alias y="yarn"
|
||||
alias ya="yarn add"
|
||||
|
||||
Reference in New Issue
Block a user