Skip to content

Commit ed67823

Browse files
committed
cmd: Clean up build-info and upgrade output
1 parent cc63c58 commit ed67823

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cmd/commandfuncs.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,11 @@ func cmdBuildInfo(fl Flags) (int, error) {
354354
return caddy.ExitCodeFailedStartup, fmt.Errorf("no build information")
355355
}
356356

357-
fmt.Printf("path: %s\n", bi.Path)
358-
fmt.Printf("main: %s %s %s\n", bi.Main.Path, bi.Main.Version, bi.Main.Sum)
357+
fmt.Printf("go_version: %s\n", runtime.Version())
358+
fmt.Printf("go_os: %s\n", runtime.GOOS)
359+
fmt.Printf("go_arch: %s\n", runtime.GOARCH)
360+
fmt.Printf("path: %s\n", bi.Path)
361+
fmt.Printf("main: %s %s %s\n", bi.Main.Path, bi.Main.Version, bi.Main.Sum)
359362
fmt.Println("dependencies:")
360363

361364
for _, goMod := range bi.Deps {
@@ -670,6 +673,7 @@ func cmdUpgrade(_ Flags) (int, error) {
670673
defer destFile.Close()
671674

672675
l.Info("downloading binary", zap.String("source", urlStr), zap.String("destination", thisExecPath))
676+
673677
_, err = io.Copy(destFile, resp.Body)
674678
if err != nil {
675679
return fmt.Errorf("unable to download file: %v", err)
@@ -687,6 +691,8 @@ func cmdUpgrade(_ Flags) (int, error) {
687691
return caddy.ExitCodeFailedStartup, err
688692
}
689693

694+
l.Info("download successful; displaying new binary details", zap.String("location", thisExecPath))
695+
690696
// use the new binary to print out version and module info
691697
fmt.Print("\nModule versions:\n\n")
692698
cmd := exec.Command(thisExecPath, "list-modules", "--versions")

0 commit comments

Comments
 (0)