jonschlinkert / copy

Copy files using glob patterns. Sync, async, promise or streams. (node.js utility)
MIT License
94 stars 125 forks source link

Cli doesn't allow `**` globbing patterns #13

Closed ashleahhill closed 7 years ago

ashleahhill commented 8 years ago

When using copy via the cli, you can only use simple patterns like the one in the example. Using the API directly works fine with the same globs. I am running Windows 10 (pre-anniversary update)

Fails

Running from the command line.

$ copy src/**/*.html foo
# The syntax of the command is incorrect.
$ copy "src/**/*.html" foo

# src/**/*.html
# The filename, directory name, or volume label syntax is incorrect.
#        0 file(s) copied.

Works

Running from script

copy('src/**/*.html', 'bar', function (err, file) {
  if (err ) console.log(err);
  console.log('files copied');
})
jonschlinkert commented 8 years ago

Hmm, even with quotes? I'll look into it. We might need to do some kind of escaping on the pattern, or perhaps the cwd isn't being set properly. thanks for reporting.