-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description of Feature / Expected vs Actual Behaviour
Wrong splitting of command attributes and it's breaking process execution.
Steps to reproduce
- Create file 'run'
#!/usr/bin/php
<?php
print_r($argv);
?>- Run:
var result = process('./run --file=test --params="add test"').death();
console.log(result.data);- It is displaying:
Array
(
[0] => ./run
[1] => --file=queue
[2] => --params="add
[3] => aa"
)But should display:
Array
(
[0] => ./run
[1] => --file=queue
[2] => --params=add aa
)Additional Information
It's not PHP problem because if you run this command directly in console it works perfectly.
https://github.com/CircleOfNice/CoreWorker/blob/master/lib/NodeProcess.js#L291
It is splitting just by space so this code
var command = './run --file=test --params="add test"';
var splittedCommand = command.split(" ");produces array:
["./run", "--file=test", '--params="add', 'test"']but it should produce:
["./run", "--file=test", '--params="add test"']You can use something like this:
https://www.npmjs.com/package/parse-spawn-args
Metadata
Metadata
Assignees
Labels
No labels