1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 13:50:09 +00:00

perf(yarn): skip yarn call if default global bin directory exists (#10290)

Fixes #10290
This commit is contained in:
Marc Cornellà 2021-12-29 15:19:59 +01:00
parent c155531402
commit 4ef188cebf
No known key found for this signature in database
GPG key ID: 0314585E776A9C1B

View file

@ -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")