diff options
-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" +} |