fix(cmd/gf): go back current working directory after gf gen pb (#3895)

This commit is contained in:
oldme
2024-11-11 20:42:25 +08:00
committed by GitHub
parent f4db846633
commit 5ba165a3c0

View File

@ -94,6 +94,9 @@ func (c CGenPb) Pb(ctx context.Context, in CGenPbInput) (out *CGenPbOutput, err
mlog.Fatalf(`no proto files found in folder "%s"`, in.Path)
}
var originPwd = gfile.Pwd()
defer gfile.Chdir(originPwd)
if err = gfile.Chdir(protoPath); err != nil {
mlog.Fatal(err)
}