fix: allow spaces in path to windres

This commit is contained in:
Lea Anthony
2019-10-25 17:35:37 +11:00
parent 11f805a97f
commit 365972619a
4 changed files with 13 additions and 8 deletions

View File

@@ -191,8 +191,15 @@ func (b *PackageHelper) PackageWindows(po *ProjectOptions, cleanUp bool) error {
// Build syso
sysofile := filepath.Join(b.fs.Cwd(), basename+"-res.syso")
windresCommand := []string{"windres", "-o", sysofile, tgtRCFile}
err := NewProgramHelper().RunCommandArray(windresCommand)
batfile, err := fs.LocalDir(".")
if err != nil {
return err
}
windresBatFile := filepath.Join(batfile.fullPath, "windres.bat")
windresCommand := []string{windresBatFile, sysofile, tgtRCFile}
err = NewProgramHelper().RunCommandArray(windresCommand)
if err != nil {
return err
}

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"os/exec"
"path/filepath"
"runtime"
"strings"
"syscall"
)
@@ -130,10 +129,6 @@ func (p *ProgramHelper) RunCommandArray(args []string, dir ...string) error {
return err
}
if runtime.GOOS == "windows" {
program = strings.ReplaceAll(program, ` `, `\ `)
}
args = args[1:]
var stderr string
var stdout string

1
cmd/windres.bat Normal file
View File

@@ -0,0 +1 @@
windres.exe -o %1 %2

4
go.mod
View File

@@ -30,4 +30,6 @@ require (
golang.org/x/text v0.3.0
gopkg.in/AlecAivazis/survey.v1 v1.8.4
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22
)
)
go 1.13