diff options
author | Steve <nilslice@gmail.com> | 2017-02-21 18:02:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 18:02:24 -0800 |
commit | 3c7327058bd2ee890d36809fd171f1477e0ebfe5 (patch) | |
tree | 9ed6e440588d9c82a110d0b7ca8237539f3d0741 | |
parent | 39e0708be1b57b5527f4c79708b25067ba50f86e (diff) | |
parent | fbce00a0b19628abd2d0c8b50c1cfa6b87cee3ce (diff) |
Merge pull request #78 from Sirikon/ponzu-dev
Fix Windows build & run
-rw-r--r-- | cmd/ponzu/main.go | 2 | ||||
-rw-r--r-- | cmd/ponzu/options.go | 2 | ||||
-rw-r--r-- | cmd/ponzu/paths.go | 12 |
3 files changed, 14 insertions, 2 deletions
diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go index d064569..6c52e01 100644 --- a/cmd/ponzu/main.go +++ b/cmd/ponzu/main.go @@ -146,7 +146,7 @@ func main() { services = "admin,api" } - serve := exec.Command("./ponzu-server", + serve := exec.Command(buildOutputName(), fmt.Sprintf("--port=%d", port), fmt.Sprintf("--httpsport=%d", httpsport), addTLS, diff --git a/cmd/ponzu/options.go b/cmd/ponzu/options.go index 43f6e05..6173368 100644 --- a/cmd/ponzu/options.go +++ b/cmd/ponzu/options.go @@ -302,7 +302,7 @@ func buildPonzuServer(args []string) error { } // execute go build -o ponzu-cms cmd/ponzu/*.go - buildOptions := []string{"build", "-o", "ponzu-server"} + buildOptions := []string{"build", "-o", buildOutputName()} cmdBuildFiles := []string{"main.go", "options.go", "generate.go", "usage.go"} var cmdBuildFilePaths []string for _, file := range cmdBuildFiles { diff --git a/cmd/ponzu/paths.go b/cmd/ponzu/paths.go new file mode 100644 index 0000000..0ab2b06 --- /dev/null +++ b/cmd/ponzu/paths.go @@ -0,0 +1,12 @@ +package main + +import "runtime" + +// buildOutputName returns the correct ponzu-server file name +// based on the host Operating System +func buildOutputName() string { + if runtime.GOOS == "windows" { + return "ponzu-server.exe" + } + return "ponzu-server" +} |