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

shx cp -r Creates nested recursive directories #209

Open
tvomacka opened this issue Feb 3, 2023 · 1 comment
Open

shx cp -r Creates nested recursive directories #209

tvomacka opened this issue Feb 3, 2023 · 1 comment

Comments

@tvomacka
Copy link

tvomacka commented Feb 3, 2023

There's a difference between the bash cp -r behavior and shx cp -r when trying to copy a directory into itself:

Create a directory ./dist with a single file in it (e.g., "test.txt") and run:

  1. (in bash) cp -ur "./dist" "./dist/prod"
  2. (with npm) "shx cp -ur "./dist" "./dist/prod""

Test 1. will result in a message saying "cp: cannot copy a directory, './dist/', into itself, './dist/prod'" but test 2. will result in a nested directory structure with a large amount of layers, each ./dist/prod subdirectory will contain another "/prod" subdirectory recursively.

Using shx version "0.3.4"

@nfischer
Copy link
Member

Look similar to (but not exactly the same as) shelljs/shelljs#1092. Should probably fix both at the same time.

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

No branches or pull requests

2 participants