question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when glob matches directory

See original GitHub issue

Currently it throws an error (EISDIR) when the glob matches a directory. I want to copy all files and directory structure to another directory. I am using cpy(['**/*'], '../output/dist', { cwd: 'assets', parents: true }, cb);. This does not work since **/* also matches the directory names.

I could make a PR to fix this if you know what behavior we should have. Should we just ignore empty directories or create them? I’m currently leaning toward creating any directories, which I think is the most intuitive.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
helmoskicommented, Dec 22, 2015

nodir is not currently an option for CLI

0reactions
danielweckcommented, Mar 5, 2018

Related issue: https://github.com/sindresorhus/cpy-cli/issues/10#issuecomment-370361001 => usage of glob **/*.* vs. **/*, typically matches folder names (no filename extension)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors with Glob while outputting file names - Stack Overflow
Your first problem is that strings, including pathnames, need to be in quotes. This: files = glob.glob(/src/xyz/rte/folder/).
Read more >
How to check if a glob has an expansion? [duplicate]
gz" files in a certain directory, I want to unzip them. But if there aren't, I don't want to see any error. If...
Read more >
Understanding the glob pattern in Node.js - LogRocket Blog
The glob pattern is most commonly used to specify filenames, called wildcard characters, and strings, called wildcard matching. The glob pattern ...
Read more >
glob - npm
If a file or directory path portion has a . as the first character, then it will not match any glob pattern unless...
Read more >
glob - the Tcler's Wiki!
glob lists all the directory entries whose names match a given pattern, optionally filtering them by type. The following two cases are errors:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found