File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 14
14
{{- end }}
15
15
16
16
{{/*
17
- We use ShellEnvHashKey to avoid re-sourcing shellenv. Since wrappers
18
- call other wrappers and potentially modify the environment, we don't want the
19
- environment to get re-written.
17
+ We use ShellEnvHashKey to prevent doing shellenv if the correct envrioment is
18
+ already set. (perf optimization)
19
+
20
+ We use the guard to prevent infinite loop if something in shellenv causes
21
+ another wrapped binary to be called. The guard is specific to this project so shellenv
22
+ could stil cause another project's shellenv to be called.
20
23
21
24
DO_NOT_TRACK=1 can be removed once we optimize segment to queue events.
22
25
*/ -}}
23
26
24
- if [[ "${{ .ShellEnvHashKey }}" != "{{ .ShellEnvHash }}" ]]; then
27
+ if [[ "${{ .ShellEnvHashKey }}" != "{{ .ShellEnvHash }}" ]] && [[ -z "${{ .ShellEnvHashKey }}_GUARD" ]]; then
28
+ export {{ .ShellEnvHashKey }}_GUARD=true
25
29
eval "$(DO_NOT_TRACK=1 devbox shellenv -c {{ .ProjectDir }})"
26
30
fi
27
31
You can’t perform that action at this time.
0 commit comments