@marcel91200 / caddy Mirror · read-only / commits / ed678235
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

cmd: Clean up `build-info` and `upgrade` output

Matthew Holt committed Feb 15, 2021 at 12:07 UTC ed678235a494c07bfb8219bf78c7ba2890377bad
1 file changed +8 -2
cmd/commandfuncs.go
+8 -2
@@ -354,8 +354,11 @@ func cmdBuildInfo(fl Flags) (int, error) {
354 return caddy.ExitCodeFailedStartup, fmt.Errorf("no build information")
355 }
356
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)
362 fmt.Println("dependencies:")
363
364 for _, goMod := range bi.Deps {
@@ -670,6 +673,7 @@ func cmdUpgrade(_ Flags) (int, error) {
673 defer destFile.Close()
674
675 l.Info("downloading binary", zap.String("source", urlStr), zap.String("destination", thisExecPath))
676 +
677 _, err = io.Copy(destFile, resp.Body)
678 if err != nil {
679 return fmt.Errorf("unable to download file: %v", err)
@@ -687,6 +691,8 @@ func cmdUpgrade(_ Flags) (int, error) {
691 return caddy.ExitCodeFailedStartup, err
692 }
693
694 + l.Info("download successful; displaying new binary details", zap.String("location", thisExecPath))
695 +
696 // use the new binary to print out version and module info
697 fmt.Print("\nModule versions:\n\n")
698 cmd := exec.Command(thisExecPath, "list-modules", "--versions")