mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-26 13:43:47 +03:00
cmd: version: Add module replace to output
This commit is contained in:
parent
e51e56a494
commit
85ff0e3604
1 changed files with 9 additions and 3 deletions
|
@ -312,12 +312,18 @@ func cmdReload(fl Flags) (int, error) {
|
|||
|
||||
func cmdVersion(_ Flags) (int, error) {
|
||||
goModule := caddy.GoModule()
|
||||
fmt.Print(goModule.Version)
|
||||
if goModule.Sum != "" {
|
||||
// a build with a known version will also have a checksum
|
||||
fmt.Printf("%s %s\n", goModule.Version, goModule.Sum)
|
||||
} else {
|
||||
fmt.Println(goModule.Version)
|
||||
fmt.Printf(" %s", goModule.Sum)
|
||||
}
|
||||
if goModule.Replace != nil {
|
||||
fmt.Printf(" => %s", goModule.Replace.Path)
|
||||
if goModule.Replace.Version != "" {
|
||||
fmt.Printf(" %s", goModule.Replace.Version)
|
||||
}
|
||||
}
|
||||
fmt.Println()
|
||||
return caddy.ExitCodeSuccess, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue