mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-27 15:30:15 +08: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,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 New Issue
Block a user