mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 06:01:52 +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:
parent
7bc4d5f7e8
commit
93a616ceef
@ -7,6 +7,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/google/shlex"
|
||||||
"github.com/pterm/pterm"
|
"github.com/pterm/pterm"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
|
|
||||||
@ -392,7 +393,10 @@ func executeBuildHook(outputLogger *clilogger.CLILogger, options *Options, hookI
|
|||||||
}
|
}
|
||||||
|
|
||||||
printBulletPoint("Executing %s build hook '%s': ", hookName, hookIdentifier)
|
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 {
|
for i, arg := range args {
|
||||||
newArg := argReplacements[arg]
|
newArg := argReplacements[arg]
|
||||||
if newArg == "" {
|
if newArg == "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user