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

ShellJS: internal error on shelljs.mkdir('myFile/myDir') #720

Closed
maikokuppe opened this issue May 14, 2017 · 0 comments · Fixed by #721
Closed

ShellJS: internal error on shelljs.mkdir('myFile/myDir') #720

maikokuppe opened this issue May 14, 2017 · 0 comments · Fixed by #721
Assignees
Labels
fix Bug/defect, or a fix for such a problem

Comments

@maikokuppe
Copy link

maikokuppe commented May 14, 2017

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

6.9.2

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

0.7.7

Operating system:

Ubuntu 16.04

Description of the bug:

ShellJS throws the following error when calling shelljs.mkdir('myFile/myDir') with an existing file myFile:

ShellJS: internal error
Error: ENOTDIR: not a directory, mkdir 'myFile/myDir'

This cannot be caught by try...catch, but should be.
Inspired by #473

Example ShellJS command to reproduce the error:

var shelljs = require('shelljs');
shelljs.touch('myFile');
shelljs.mkdir('myFile/myDir');
@nfischer nfischer self-assigned this May 14, 2017
@nfischer nfischer added the fix Bug/defect, or a fix for such a problem label May 14, 2017
nfischer added a commit that referenced this issue May 14, 2017
In particular, this fixes:

 - if we try to overwrite a file with a mkdir
 - if we try to create a subdirectory of a file
 - adds `continue: true` in spots where we missed it

Fixes #720
nfischer added a commit that referenced this issue May 16, 2017
* fix(mkdir): improve error handling around files

In particular, this fixes:

 - if we try to overwrite a file with a mkdir
 - if we try to create a subdirectory of a file
 - adds `continue: true` in spots where we missed it

Fixes #720

* Fixing tests on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug/defect, or a fix for such a problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants