Hello everyone,
I am having some problems to execute the processing-java on windows from nodejs. When I use the following
processing-java --sketch=$pwd/sketch/ --run
in the console it works fine and the sketch is executed, window opens and the result is a file written to a directory where I need it.
But when I use the same as a string in the node file to execute it, it does not open a window and no file has been written, but the callback function processOutput
is executed, hence the somehow the execution happened.
I added
const exec = require('child_process').exec;
to the js file which is used for executing child processes in node.
$pwd
is the PowerShell equivalent to pwd
on MacOS.
exec
should execute the shell command and call the callback function (which seems to happen)
const cmd = 'processing-java --sketch=$pwd/sketch/ --run';
exec(cmd, processOutput);
What am I missing? Any help appreceated.
Many thanks, C.