summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2021-02-15 12:07:35 -0700
committerMatthew Holt <[email protected]>2021-02-15 12:07:55 -0700
commited678235a494c07bfb8219bf78c7ba2890377bad (patch)
treef762858e248862ea5c1373a468120c5c13ed819a
parentcc63c5805e1587d7e5901deaad3f5bac944a2cf6 (diff)
downloadcaddy-ed678235a494c07bfb8219bf78c7ba2890377bad.tar.gz
caddy-ed678235a494c07bfb8219bf78c7ba2890377bad.zip
cmd: Clean up `build-info` and `upgrade` outputv2.4.0-beta.1
-rw-r--r--cmd/commandfuncs.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go
index f3feb6105..2b437c3b5 100644
--- a/cmd/commandfuncs.go
+++ b/cmd/commandfuncs.go
@@ -354,8 +354,11 @@ func cmdBuildInfo(fl Flags) (int, error) {
return caddy.ExitCodeFailedStartup, fmt.Errorf("no build information")
}
- fmt.Printf("path: %s\n", bi.Path)
- fmt.Printf("main: %s %s %s\n", bi.Main.Path, bi.Main.Version, bi.Main.Sum)
+ fmt.Printf("go_version: %s\n", runtime.Version())
+ fmt.Printf("go_os: %s\n", runtime.GOOS)
+ fmt.Printf("go_arch: %s\n", runtime.GOARCH)
+ fmt.Printf("path: %s\n", bi.Path)
+ fmt.Printf("main: %s %s %s\n", bi.Main.Path, bi.Main.Version, bi.Main.Sum)
fmt.Println("dependencies:")
for _, goMod := range bi.Deps {
@@ -670,6 +673,7 @@ func cmdUpgrade(_ Flags) (int, error) {
defer destFile.Close()
l.Info("downloading binary", zap.String("source", urlStr), zap.String("destination", thisExecPath))
+
_, err = io.Copy(destFile, resp.Body)
if err != nil {
return fmt.Errorf("unable to download file: %v", err)
@@ -687,6 +691,8 @@ func cmdUpgrade(_ Flags) (int, error) {
return caddy.ExitCodeFailedStartup, err
}
+ l.Info("download successful; displaying new binary details", zap.String("location", thisExecPath))
+
// use the new binary to print out version and module info
fmt.Print("\nModule versions:\n\n")
cmd := exec.Command(thisExecPath, "list-modules", "--versions")