I am trying to execute a child process in a different directory then the one of its parent.
var script = "drush language-add cn";
var folderDrush = "/data/www/sites/site_cn_country";
exec(script, {cwd:folderDrush} , function (err, stdout, stderr) {
if(err) {
sendErr("drush", stderr);
sendCommand(script);
sendCheck("drush", false);
}
});
This script returns:
The drush command 'language-add cs' could not be found. Run
drush [31;40m[1m[error][0m cache-clear drush
to clear the commandfile cache if you have installed new extensions.
But when I execute manualy, drush language-add work fine.
I test there commands too :
pwd : /data/www/sites/site_cn_country
id -u -n : root
ll : Command not found (why ? manually work...)
echo $SHELL : /bin/bash