mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 05:40:08 +00:00
perf(yarn): skip yarn
call if default global bin directory exists (#10290)
Fixes #10290
This commit is contained in:
parent
c155531402
commit
4ef188cebf
1 changed files with 5 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
|||
# Add yarn bin directory to $PATH if it exists and not in $PATH already
|
||||
bindir=$(yarn global bin 2>/dev/null) \
|
||||
# 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")
|
||||
|
|
Loading…
Reference in a new issue