builds, trying args
This commit is contained in:
parent
c3e3805f66
commit
a8580683de
12
cmd_build.go
12
cmd_build.go
|
@ -1,6 +1,10 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import ()
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"os/exec"
|
||||||
|
)
|
||||||
|
|
||||||
var buildCmd = &Command{
|
var buildCmd = &Command{
|
||||||
Name: "build",
|
Name: "build",
|
||||||
|
@ -11,5 +15,9 @@ var buildCmd = &Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildRun(cmd *Command, args ...string) {
|
func buildRun(cmd *Command, args ...string) {
|
||||||
|
out, err := exec.Command("go", "build", "-ldflags", fmt.Sprintf("\"-X main.Build.Date %s main.Build.GitHash %s main.Build.Num %d\"", "2014-12-08", "a1b2c3d4", 107)).Output()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
fmt.Printf("%s\n", out)
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ Usage:
|
||||||
var usageTmpl = template.Must(template.New("usage").Parse(`
|
var usageTmpl = template.Must(template.New("usage").Parse(`
|
||||||
Commands:{{range .}}
|
Commands:{{range .}}
|
||||||
{{.Name | printf "%-10s"}} {{.Summary}}{{end}}
|
{{.Name | printf "%-10s"}} {{.Summary}}{{end}}
|
||||||
`))
|
`))
|
||||||
|
|
||||||
var commands = []*Command{
|
var commands = []*Command{
|
||||||
buildCmd,
|
buildCmd,
|
||||||
|
|
Loading…
Reference in New Issue