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

CP on a folder fails when not following symlinks #937

Open
xastor opened this issue Apr 23, 2019 · 0 comments
Open

CP on a folder fails when not following symlinks #937

xastor opened this issue Apr 23, 2019 · 0 comments

Comments

@xastor
Copy link

@xastor xastor commented Apr 23, 2019

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

v10.15.3

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

master (9237f66 on Mar 6)

Operating system:

ElementaryOS 5 Juno (Ubuntu bionic based-

Description of the bug:

Copying a folder with symlinks disabled (cp -RP) , fails because it is trying to be copied as a file.

Example ShellJS command to reproduce the error:

pieter@officepib:~$ cd /tmp
pieter@officepib:/tmp$ mkdir TestFolder
pieter@officepib:/tmp$ touch TestFolder/bla
pieter@officepib:/tmp$ shx cp -P TestFolder TestFolder2
/usr/lib/node_modules/shx/node_modules/shelljs/src/common.js:399
        throw e;
        ^

ShellJSInternalError: EISDIR: illegal operation on a directory, read
    at Object.readSync (fs.js:493:3)
    at copyFileSync (/usr/lib/node_modules/shx/node_modules/shelljs/src/cp.js:70:22)
    at /usr/lib/node_modules/shx/node_modules/shelljs/src/cp.js:298:7
    at Array.forEach (<anonymous>)
    at _cp (/usr/lib/node_modules/shx/node_modules/shelljs/src/cp.js:243:11)
    at /usr/lib/node_modules/shx/node_modules/shelljs/src/common.js:384:25
    at shx (/usr/lib/node_modules/shx/lib/shx.js:139:37)
    at run (/usr/lib/node_modules/shx/lib/cli.js:20:31)
    at Object.<anonymous> (/usr/lib/node_modules/shx/lib/cli.js:39:3)
    at Module._compile (internal/modules/cjs/loader.js:701:30)

On cp.js:250 seems to only go into a directory when following symlinks is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.