Skip to content

Commit 13d67aa

Browse files
committed
builder: Print load commands output on default
Now load command output will be printed on default. To disable this add "hide_load_output: 1" to ~/.newt/newtrc.yml
1 parent c6bf556 commit 13d67aa

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

newt/builder/load.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,23 @@ func Load(binBasePath string, bspPkg *pkg.BspPackage,
158158
binBasePath,
159159
}
160160

161-
util.StatusMessage(util.VERBOSITY_VERBOSE, "Load command: %s\n",
161+
util.StatusMessage(util.VERBOSITY_DEFAULT, "Load command: %s\n",
162162
strings.Join(cmd, " "))
163163
util.StatusMessage(util.VERBOSITY_VERBOSE, "Environment:\n")
164164
for _, v := range env {
165165
util.StatusMessage(util.VERBOSITY_VERBOSE, "* %s\n", v)
166166
}
167-
if _, err := util.ShellCommand(cmd, env); err != nil {
167+
168+
o, err := util.ShellCommand(cmd, env)
169+
if err != nil {
168170
return err
169171
}
170-
util.StatusMessage(util.VERBOSITY_VERBOSE, "Successfully loaded image.\n")
172+
173+
if !util.HideLoadCmdOutput {
174+
util.StatusMessage(util.VERBOSITY_DEFAULT, "%s", o)
175+
}
176+
177+
util.StatusMessage(util.VERBOSITY_DEFAULT, "Successfully loaded image.\n")
171178

172179
return nil
173180
}

newt/settings/settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func processNewtrc(yc ycfg.YCfg) {
5959

6060
util.SkipNewtCompat, _ = yc.GetValBoolDflt("skip_newt_compat", nil, false)
6161
util.SkipSyscfgRepoHash, _ = yc.GetValBoolDflt("skip_syscfg_repo_hash", nil, false)
62+
util.HideLoadCmdOutput, _ = yc.GetValBoolDflt("hide_load_output", nil, false)
6263
}
6364

6465
func readNewtrc() ycfg.YCfg {

util/util.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var ShallowCloneDepth int
5252
var logFile *os.File
5353
var SkipNewtCompat bool
5454
var SkipSyscfgRepoHash bool
55+
var HideLoadCmdOutput bool
5556

5657
func ParseEqualsPair(v string) (string, string, error) {
5758
s := strings.Split(v, "=")

0 commit comments

Comments
 (0)