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

wildcard vs explicit paths have different output #105

Open
sndrs opened this issue Sep 15, 2022 · 3 comments
Open

wildcard vs explicit paths have different output #105

sndrs opened this issue Sep 15, 2022 · 3 comments

Comments

@sndrs
Copy link

sndrs commented Sep 15, 2022

given the following file structure:

src/
├── hello-world.js
└── README.md

running the following with 9.0.1:

cpy([
  'src/*.md', 
  'src/hello-world.js'
], 'dist')

creates:

dist/
├── src/
│   └── hello-world.js
└── README.md

Apologies if I misunderstood, but is this expected?

I would expect both globs to create the same out structure.

example here: https://replit.com/join/obiaxjzgca-sndrs

sndrs added a commit to guardian/csnx that referenced this issue Sep 15, 2022
v9 seems to have a bug in it sindresorhus/cpy#105 (or i dont get something which i will have to make 9 work)
@sindresorhus
Copy link
Owner

That does indeed look like a bug.

@sindresorhus
Copy link
Owner

// @Idered

@dls314
Copy link

dls314 commented Oct 11, 2022

Possibly related, there seems to be a difference between windows/*nix when cpy-cli reuses cpy that is similar in expression to this bug. That is, when globs are used, on *nix the output includes the directory (like src above) unless the --flat flag is used. On windows, no --flat is necessary to prevent it.

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

3 participants