Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

shell.exec() doesn't respond correctly to config.fatal = true #735

Copy link
Copy link
@nfischer

Description

@nfischer
Issue body actions

Node version (or tell us if you're using electron or some other framework):

all

ShellJS version (the most recent version/Github branch you see the bug on):

master

Operating system:

all

Description of the bug:

Setting config.fatal = true messes up shell.exec(). When config.fatal is true, we throw an exception from common.error(). Unfortunately, this gets caught by ShellJS and is treated like an internal error, which isn't correct.

Example ShellJS command to reproduce the error:

> shell.config.fatal = true;
> shell.exec('cmd_that_fails');
Error: exec: internal error
    at Object.error (/path/to/shelljs/src/common.js:130:27)
    at Object._exec (/path/to/shelljs/src/exec.js:292:12)
    at Object.exec (/path/to/shelljs/src/common.js:334:23)
    at repl:1:3
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:313:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
> // the exception is expected to contain the command's stderr
not-an-aardvark, pibi and chadoh

Metadata

Metadata

Assignees

Labels

execIssues specific to the shell.exec() APIIssues specific to the shell.exec() APIfixBug/defect, or a fix for such a problemBug/defect, or a fix for such a problemstability

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.