Created
June 13, 2019 16:18
-
-
Save chirino/c095ac4696130750408f17d7bf4cb35c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mysh = sh.New(). | |
CommandLog(os.Stdout). | |
CommandLogPrefix("> "). | |
Env(map[string]string{ | |
"CGO_ENABLED": "0", | |
"GOOS": "linux", | |
"GOARCH": "amd64", | |
}). | |
Dir("./target") | |
func run(line string) { | |
// functions on mysh return new immutable objects, | |
// so we can reuse it without fear. | |
mysh.Line(line).MustExec() | |
} | |
func BuildExecutable() { | |
// Note: "my app" will be a single argument to the go command | |
run(`go build -o "my app" github.com/chirino/cmd/myapp`) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment