Skip to content
New issue

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

Error shown when triggering a sigint during shelljs.exec if process.on sigint is defined #254

Closed
pajtai opened this issue Nov 14, 2015 · 5 comments
Labels
exec Issues specific to the shell.exec() API fix Bug/defect, or a fix for such a problem help wanted low priority

Comments

@pajtai
Copy link

pajtai commented Nov 14, 2015

Execute this file to reproduce

#!/usr/bin/env node
'use strict';

process.on('SIGINT', function() { console.log('done'); });
var exec = require('shelljs').exec('sleep 30');

Now press ctr-c before the sleep is done and you get an error like the following:

^Cshell.js: internal error
Error: ENOENT: no such file or directory, open '/var/folders/s1/hl12yyyd0n3djffckxzc8fdm0000gp/T/shelljs_639bf41add87c30b7ccb'
at Error (native)
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:431:33)
at execSync

@ariporad ariporad added the fix Bug/defect, or a fix for such a problem label Jan 9, 2016
@bompi88
Copy link

bompi88 commented Jan 29, 2016

+1

@nfischer
Copy link
Member

Confirmed. I think this has to do with the way we force exec to be synchronous (by writing to temp files)

@cqgao
Copy link

cqgao commented Aug 24, 2016

+1

@nfischer nfischer added the exec Issues specific to the shell.exec() API label May 9, 2018
@nfischer
Copy link
Member

I'm going to merge this into #495. The new design won't use tempfiles by default.

@HamidOsouli-zz
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exec Issues specific to the shell.exec() API fix Bug/defect, or a fix for such a problem help wanted low priority
Projects
None yet
Development

No branches or pull requests

6 participants