Skip to content
Snippets Groups Projects
Commit a0efeb84 authored by Johan de Klerk's avatar Johan de Klerk
Browse files

Build windows app

parent b925b38c
No related branches found
No related tags found
No related merge requests found
......@@ -111,6 +111,32 @@ func BuildGolangApp(outputDir string, appPath string, module string, isDebug boo
return nil
}
func BuildGolangAppWindows(outputDir string, appPath string, module string, isDebug bool) error {
commandArgs := []string{
`build`,
fmt.Sprintf(`-ldflags=-X %v/globals.BuildVersion=%v -X %v/globals.OSType=%v -X %v/globals.IsDebugBuild=%v`, module, CurrentCommit(), module, runtime.GOOS, module, isDebug),
}
if isDebug {
commandArgs = append(commandArgs, "-gcflags", "all=-N -l")
}
commandArgs = append(commandArgs, `-o`,
outputDir,
appPath)
env := map[string]string{
"GOOS": "windows",
"GOARCH": "amd64",
}
err := sh.RunWith(env, "go", commandArgs...)
if err != nil {
return err
}
return nil
}
func BuildMJML(filename string) error {
// Get the full path to the file
currentDir, _ := os.Getwd()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment