Move printing to stdout up to the command itself

Signed-off-by: Andy Caldwell <andrew.caldwell@metaswitch.com>
This commit is contained in:
Andy Caldwell
2021-08-20 15:09:56 +01:00
parent 3ab0b6953a
commit ef3e46fd62
2 changed files with 18 additions and 17 deletions

View File

@ -54,7 +54,6 @@ type Options struct {
BuildArgs map[string]string
Pull bool
ImageIDFile string
Quiet bool
ExtraHosts []string
NetworkMode string
@ -685,9 +684,6 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do
respMu.Unlock()
if len(res) == 1 {
digest := res[0].ExporterResponse["containerimage.digest"]
if opt.Quiet {
fmt.Println(digest)
}
if opt.ImageIDFile != "" {
return ioutil.WriteFile(opt.ImageIDFile, []byte(digest), 0644)
}
@ -718,9 +714,6 @@ func Build(ctx context.Context, drivers []DriverInfo, opt map[string]Options, do
if err != nil {
return err
}
if opt.Quiet {
fmt.Println(desc.Digest)
}
if opt.ImageIDFile != "" {
return ioutil.WriteFile(opt.ImageIDFile, []byte(desc.Digest), 0644)
}