Skip to content

Commit e56371e

Browse files
authored
fix(cmd/gf): incorrect environment variables printing before cli does some environment changes (#3961)
1 parent eb80249 commit e56371e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cmd/gf/internal/cmd/cmd_build.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,6 @@ type cBuildInput struct {
138138
type cBuildOutput struct{}
139139

140140
func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, err error) {
141-
// print used go env
142-
if in.DumpENV {
143-
_, _ = Env.Index(ctx, cEnvInput{})
144-
}
145-
146141
mlog.SetHeaderPrint(true)
147142

148143
mlog.Debugf(`build command input: %+v`, in)
@@ -241,6 +236,10 @@ func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, e
241236
} else {
242237
genv.MustSet("CGO_ENABLED", "0")
243238
}
239+
// print used go env
240+
if in.DumpENV {
241+
_, _ = Env.Index(ctx, cEnvInput{})
242+
}
244243
for system, item := range platformMap {
245244
if len(customSystems) > 0 && customSystems[0] != "all" && !gstr.InArray(customSystems, system) {
246245
continue

0 commit comments

Comments
 (0)