Skip to content

Commit 6742e3b

Browse files
committed
fix: use strings.Fields to collapse whitespace in prepareCmd
strings.Split on a single space produces empty-string arguments when the command string contains multiple consecutive spaces (e.g. "php app.php" → ["php", "", "app.php"]). strings.Fields trims leading/trailing whitespace and collapses runs of whitespace, matching user intent.
1 parent 4fbba01 commit 6742e3b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type internalCmdWithArgs func(command []string) *exec.Cmd
2626
// slice is used as-is.
2727
func prepareCmd(command []string) []string {
2828
if len(command) == 1 {
29-
return strings.Split(command[0], " ")
29+
return strings.Fields(command[0])
3030
}
3131
return command
3232
}

0 commit comments

Comments
 (0)