5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 08:29:40 +08:00

[bugfix] build hook command parsing (#2836)

* fix build hook command parsing

use `shlex`, rather than `strings` package, to split build command

* fix compiler error
This commit is contained in:
Nobleman 2023-08-27 16:50:13 -06:00 committed by GitHub
parent 7bc4d5f7e8
commit 93a616ceef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ import (
"runtime"
"strings"
"github.com/google/shlex"
"github.com/pterm/pterm"
"github.com/samber/lo"
@ -392,7 +393,10 @@ func executeBuildHook(outputLogger *clilogger.CLILogger, options *Options, hookI
}
printBulletPoint("Executing %s build hook '%s': ", hookName, hookIdentifier)
args := strings.Split(buildHook, " ")
args, err := shlex.Split(buildHook)
if err != nil {
return fmt.Errorf("could not parse %s build hook command: %w", hookName, err)
}
for i, arg := range args {
newArg := argReplacements[arg]
if newArg == "" {