Skip to content

shelljs should not kill process if node call throws exception #473

@TimBarham

Description

@TimBarham

Node version:

4.4.7

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

0.7.0

Operating system:

Windows 10

Description of the bug:

I'm working on code that calls shelljs mkdir to create a directory. On Windows, the call to fs.mkdir() sometimes fails because of permission issues or whatever. This is a failure that I should be able to catch with a try/catch. But shelljs catches the error, outputs it to the console and exits the process (here). A utility like shelljs should never take such drastic action - it should be up to me the consumer to decide what to do with such an error.

Example ShellJS command to reproduce the error:

On windows:

var shelljs = require('shelljs');
shelljs.mkdir('c:\\Program Files\\foo');

It should just throw in this situation so I can catch the error and decide what to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions