mirror of
https://github.com/beego/bee.git
synced 2024-12-22 20:20:49 +00:00
This fixes #295
This commit is contained in:
parent
1d8aa1a48d
commit
5cc09e5c6c
@ -57,7 +57,7 @@ func show(out io.Writer, content string) {
|
||||
}
|
||||
|
||||
err = t.Execute(out, vars{
|
||||
runtime.Version(),
|
||||
getGoVersion(),
|
||||
runtime.GOOS,
|
||||
runtime.GOARCH,
|
||||
runtime.NumCPU(),
|
||||
|
15
version.go
15
version.go
@ -6,8 +6,10 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
path "path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var cmdVersion = &Command{
|
||||
@ -114,3 +116,16 @@ func getBeegoVersion() string {
|
||||
}
|
||||
return "Beego not installed. Please install it first: https://github.com/astaxie/beego"
|
||||
}
|
||||
|
||||
func getGoVersion() string {
|
||||
var (
|
||||
cmdOut []byte
|
||||
err error
|
||||
)
|
||||
|
||||
if cmdOut, err = exec.Command("go", "version").Output(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "There was an error running go version command:", err)
|
||||
os.Exit(2)
|
||||
}
|
||||
return strings.Split(string(cmdOut), " ")[2]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user