I created a command that starts a php server… which worked only I added cmd, I don’t why it didn’t work with cd dispatch && ... the rest
var options = {
args: ["php", "-S", "localhost:9000"],
cwd: dir,
shell: true
};
console.log(options.args.join(" "));
phpServerProcess = new Process("/usr/bin/env", options);
phpServerProcess.start();
phpServerProcess.onStdout(function (data) {
console.log(data);
});
But now the problem is that the stdout is empty. How should I configure it to work? For other tools it works.
Second I needed a command to stop the php server with the following options
["kill" ,"$(ps" ,"aux", "|", "grep" ,"'localhost:9000'", "|", "awk", "'{print $2}')"]
which is successfully convert to
kill $(ps aux | grep 'localhost:9000' | awk '{print $2}')
If I run the command by hand in terminal it successfully stops the php server but when I run the command inside nova… it doesn’t. I’m sure that it reaches and runs the code because I print the process args
console.log(options.args.join(" "));
But there is not stdout, errors… nothing.
In the end I stopped the process with:
phpServerProcess.kill();
But still I’m curious why the other implementations didn’t work? I still can’t see the stdout…
I also tried with this
stdio: ["pipe", "pipe", "pipe"],