diff --git a/src/Commands/ServeCommand.php b/src/Commands/ServeCommand.php index 6371801..f5d72a8 100755 --- a/src/Commands/ServeCommand.php +++ b/src/Commands/ServeCommand.php @@ -210,7 +210,8 @@ protected function buildWatcherCommand() $phpCommand = $this->buildPhpServerCommand(); if ($this->isWindows()) { - return "npx @leafphp/watcher --watch .env --exec " . escapeshellarg($phpCommand); + $phpCommand = str_replace('"', '\\"', $phpCommand); + return "\"npx @leafphp/watcher --watch .env --exec \\\"$phpCommand\\\"\""; } return escapeshellcmd("npx @leafphp/watcher --watch .env --exec \"$phpCommand\""); @@ -222,7 +223,7 @@ protected function buildWatcherCommand() protected function buildNpmRunCommand($script) { if ($this->isWindows()) { - return "npm run $script"; + return "\"npm run $script\""; } return "\"npm run $script\"";