Skip to content

Commit ed2e05f

Browse files
authored
fix: missing exclusion of rehash on init (#437)
Cut time by 75% ~ via 🐹 v1.23.4 via 🐍 v3.12.8 (main) on ☁️ ➜ time eval "$(goenv init -)" real 0m0.755s user 0m0.138s sys 0m0.207s ~ via 🐹 v1.23.4 via 🐍 v3.12.8 (main) on ☁️ ➜ time eval "$(goenv init - --no-rehash)" real 0m0.407s user 0m0.099s sys 0m0.140s After fix: ~ via 🐹 v1.23.4 via 🐍 v3.12.8 (main) on ☁️ ➜ time eval "$(goenv init - --no-rehash)" real 0m0.133s user 0m0.032s sys 0m0.051s Signed-off-by: Justin Lecher <[email protected]>
1 parent dacd2a8 commit ed2e05f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

β€Žlibexec/goenv-init

+5-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ if [ "$shell" != "fish" ]; then
183183
EOS
184184
fi
185185

186-
# NOTE: Rehash again, but only to export managed paths
187-
cat <<EOS
188-
goenv rehash --only-manage-paths
186+
if [ -z "$no_rehash" ]; then
187+
# NOTE: Rehash again, but only to export managed paths
188+
cat <<EOS
189+
goenv rehash --only-manage-paths
189190
EOS
191+
fi

0 commit comments

Comments
Β (0)