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

[v1] better arg passing to wails serve

This commit is contained in:
Lea Anthony 2021-05-30 11:17:33 +10:00
parent 5302ce57db
commit d20155a03b
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -477,7 +477,17 @@ func ServeProject(projectOptions *ProjectOptions, logger *Logger) error {
logger.Yellow("Serving Application: " + location) logger.Yellow("Serving Application: " + location)
var args []string var args []string
if len(os.Args) > 2 { if len(os.Args) > 2 {
args = os.Args[2:] foundArgSep := false
for index, arg := range os.Args[2:] {
if arg == "--" {
foundArgSep = true
continue
}
if foundArgSep {
args = os.Args[index:]
break
}
}
logger.Yellow("Passing arguments: %+v", args) logger.Yellow("Passing arguments: %+v", args)
} }
cmd := exec.Command(location, args...) cmd := exec.Command(location, args...)