Closed maryo closed 8 years ago
It's there so that stop
would work on linux. See note in Symfony documentation - php wraps command in separate sh
process, so when stop
is called, it stops that sh
process and node
(dev-server) process is still running in the background. Another cannot be started as port is already taken.
I haven't found any information about what's the case in Windows for that separate sh
process.
One solution could be just to avoid exec
on windows machines, but it could still leave processes in the background, which would not be nice. Could you check this on your machine:
exec
)node
process stopped and second started successfully?Thanks.
Another way to deal would be just ignoring changes in twig files - they are not changed so frequently and when configuration is changed (like config.yml), command still needs manual restart, so this does not handle all the cases.
OK. I see. I've tried it and looks like it works. From the Symfony doc:
POSIX signals are not available on Windows platforms, please refer to the PHP documentation for available signals.
Symfony handles stopping of the process differently on Windows.
Check this line https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Process/Process.php#L1522
PR sent
Fixed by #14. Thanks!
I am running on Windows and when I try to run the
maba:webpack:dev-server
command then I get'"exec"' is not recognized as an internal or external command, operable program or batch file.
message.So I've temporarily commented out line 76 inside
src/Compiler/WebpackCompiler.php
-// array('exec'),
which fixed it. I'd sent a PR but since I'm not a Linux expert I'm not sure why exactly theexec
is present. Could it be removed? Or should there be a condition for OS? Which solution do you prefer? Or another one?EDIT: Another workarround without editing vendor code is to shim exec command by creating
exec.cmd
file inside the project root containing@%*
.Thanks for this great bundle.