From e56371e7c9ba407f4d6d407cc27cf850a6f5e465 Mon Sep 17 00:00:00 2001 From: ppanphper Date: Sat, 23 Nov 2024 17:54:20 +0800 Subject: [PATCH] fix(cmd/gf): incorrect environment variables printing before cli does some environment changes (#3961) --- cmd/gf/internal/cmd/cmd_build.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/gf/internal/cmd/cmd_build.go b/cmd/gf/internal/cmd/cmd_build.go index 182ee370b..2454da574 100644 --- a/cmd/gf/internal/cmd/cmd_build.go +++ b/cmd/gf/internal/cmd/cmd_build.go @@ -138,11 +138,6 @@ type cBuildInput struct { type cBuildOutput struct{} func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, err error) { - // print used go env - if in.DumpENV { - _, _ = Env.Index(ctx, cEnvInput{}) - } - mlog.SetHeaderPrint(true) mlog.Debugf(`build command input: %+v`, in) @@ -241,6 +236,10 @@ func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, e } else { genv.MustSet("CGO_ENABLED", "0") } + // print used go env + if in.DumpENV { + _, _ = Env.Index(ctx, cEnvInput{}) + } for system, item := range platformMap { if len(customSystems) > 0 && customSystems[0] != "all" && !gstr.InArray(customSystems, system) { continue