building args cmd works, need content
This commit is contained in:
parent
a8580683de
commit
4d9d215c43
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,9 +16,13 @@ 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()
|
mycmd := exec.Command("go", "build", "-ldflags", fmt.Sprintf("-X main.Build.Date %s -X main.Build.GitHash %s -X main.Build.Num %d\"", "2014-12-08", "a1b2c3d4", 107))
|
||||||
|
fmt.Println(mycmd.Args)
|
||||||
|
fmt.Println(mycmd.Env)
|
||||||
|
mycmd.Stderr = os.Stderr
|
||||||
|
mycmd.Stdout = os.Stdout
|
||||||
|
err := mycmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
fmt.Printf("%s\n", out)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue