sindresorhus / cpy-cli

Copy files
MIT License
345 stars 33 forks source link

Add `no-dir` flag #5

Closed kevva closed 5 years ago

kevva commented 8 years ago

Related to https://github.com/sindresorhus/cpy/issues/10. When copying all files and directories in a directory you'll end up with a EISDIR failure. And since nodir wasn't passed there was no way to fix it.

kevva commented 8 years ago

Hmm, doesn't seem to work fully since --no-dir gets treated as a string so it have to matched as 'false'.

kevva commented 8 years ago

Should be fixed now. I think overwrite needs fixing as well.

sindresorhus commented 8 years ago

Remind me, why is this needed again? Seems like it should just be default behavior.

// @schnittstabil

schnittstabil commented 8 years ago

@sindresorhus The problem: **/* also matches directories, which isn't expected by some (or most?) users. On the other side, a --recusive option needs patterns to match directories, especially in case of empty directories.

I'm working on --recusive for some time, but sadly the current version is far too complicated atm.

@kevva s PR won't fix sindresorhus/cpy#10, but alleviates that problem, and because cpy already supports nodir due to globby/node-glob, I'm fine with it.

@sindresorhus Please also note #3 ("Added nodir option to cli.") of @chimon2000.

kevva commented 8 years ago

Yeah, currently this module is unusable if you have files nested in directories since it'll error out when trying to read the dirs.

danielweck commented 6 years ago

Is there anything blocking this PR? This would fix: https://github.com/sindresorhus/cpy/issues/10 https://github.com/sindresorhus/cpy/issues/40 https://github.com/sindresorhus/cpy-cli/issues/10 ...right?

kevva commented 6 years ago

Bumping globby in https://github.com/sindresorhus/cpy will fix this issue.

danielweck commented 6 years ago

Thanks @kevva ...but in this case could you please clarify whether using cpy-cli without the nodir command line option will behave as if folders were ignored by default when using the file glob **/* or **/*.*?

kevva commented 6 years ago

@danielweck, yes, they'll be ignored.

revelt commented 5 years ago

hi guys! Sorry to bother but this PR seems to be gathering dust a little bit. What is needed to move it forward? Or should we just delete it?

sindresorhus commented 5 years ago

Closing in favor of https://github.com/sindresorhus/cpy-cli/issues/10