We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This ShellJS script will stall indefinitely, if 'nosuchfile.txt' doesn't exist.
require('shelljs/global') exec("cat < nosuchfile.txt")
Will cause shelljs to stall
This fixes it:
cmd += ' > '+stdoutFile+' 2>&1'; // works on both win/unix var script = "var child = require('child_process'), path=require('path'), \ fs = require('fs'); \ child.exec('"+escape(cmd)+"', {env: process.env}, function(err,stdout,stderr) { \ fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0'); \ if(!path.existsSync('"+escape(stdoutFile)+"')){ fs.writeFileSync('"+escape(stdoutFile)+"',stdout.toString()+stderr.toString()); }; \ }); \ process.on('uncaughtException',function(err){ \ if(!path.existsSync('"+escape(stdoutFile)+"')){ fs.writeFileSync('"+escape(stdoutFile)+"',err.toString()); } \ if(!path.existsSync('"+escape(codeFile)+"')){ fs.writeFileSync('"+escape(codeFile)+"','-1'); } \ }); \ process.on('exit',function(){ \ if(!path.existsSync('"+escape(stdoutFile)+"')){ fs.writeFileSync('"+escape(stdoutFile)+"','Uncaught ShellJS Error'); } \ if(!path.existsSync('"+escape(codeFile)+"')){ fs.writeFileSync('"+escape(codeFile)+"','-1'); } \ });" if (fs.existsSync(scriptFile)) _unlinkSync(scriptFile); if (fs.existsSync(stdoutFile)) _unlinkSync(stdoutFile); if (fs.existsSync(codeFile)) _unlinkSync(codeFile);
We have forked your repo, here: https://github.com/croteb/shelljs and will be keeping it current with our fixes.
Thanks!
The text was updated successfully, but these errors were encountered:
@celer would you be able to open this as a PR? I'd love to take a look!
Sorry, something went wrong.
Closing this, since the relevant code path is no longer supported.
No branches or pull requests
This ShellJS script will stall indefinitely, if 'nosuchfile.txt' doesn't exist.
Will cause shelljs to stall
This fixes it:
We have forked your repo, here: https://github.com/croteb/shelljs and will be keeping it current with our fixes.
Thanks!
The text was updated successfully, but these errors were encountered: