mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-10 23:40:06 -05:00
cmd: Clean up build-info
and upgrade
output
This commit is contained in:
parent
cc63c5805e
commit
ed678235a4
1 changed files with 8 additions and 2 deletions
|
@ -354,6 +354,9 @@ func cmdBuildInfo(fl Flags) (int, error) {
|
||||||
return caddy.ExitCodeFailedStartup, fmt.Errorf("no build information")
|
return caddy.ExitCodeFailedStartup, fmt.Errorf("no build information")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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("path: %s\n", bi.Path)
|
||||||
fmt.Printf("main: %s %s %s\n", bi.Main.Path, bi.Main.Version, bi.Main.Sum)
|
fmt.Printf("main: %s %s %s\n", bi.Main.Path, bi.Main.Version, bi.Main.Sum)
|
||||||
fmt.Println("dependencies:")
|
fmt.Println("dependencies:")
|
||||||
|
@ -670,6 +673,7 @@ func cmdUpgrade(_ Flags) (int, error) {
|
||||||
defer destFile.Close()
|
defer destFile.Close()
|
||||||
|
|
||||||
l.Info("downloading binary", zap.String("source", urlStr), zap.String("destination", thisExecPath))
|
l.Info("downloading binary", zap.String("source", urlStr), zap.String("destination", thisExecPath))
|
||||||
|
|
||||||
_, err = io.Copy(destFile, resp.Body)
|
_, err = io.Copy(destFile, resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to download file: %v", err)
|
return fmt.Errorf("unable to download file: %v", err)
|
||||||
|
@ -687,6 +691,8 @@ func cmdUpgrade(_ Flags) (int, error) {
|
||||||
return caddy.ExitCodeFailedStartup, err
|
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
|
// use the new binary to print out version and module info
|
||||||
fmt.Print("\nModule versions:\n\n")
|
fmt.Print("\nModule versions:\n\n")
|
||||||
cmd := exec.Command(thisExecPath, "list-modules", "--versions")
|
cmd := exec.Command(thisExecPath, "list-modules", "--versions")
|
||||||
|
|
Loading…
Add table
Reference in a new issue