sindresorhus / cpy-cli

Copy files
MIT License
344 stars 33 forks source link

option for ignore error if not found files #6

Closed alexander-akait closed 8 years ago

alexander-akait commented 8 years ago

I run.

cpy 'public/**/*.*' '../build/' --cwd=src --parents

Output:

Cannot glob `public/**/*.*,!**/*-src.*`: Cannot copy from `/path/to/src/public/**/*.*` to `/path/to/build/public/**/*.*`: cannot read from `/path/to/public/**/*.*`: ENOENT: no such file or directory, open '/path/to/src/public/**/*.*'
schnittstabil commented 8 years ago

@evilebottnawi Hmm, what exactly bothers you? The message, the exit code or both? – Can you give us some context, why this feature is useful for you?

alexander-akait commented 8 years ago

@schnittstabil exit code, i use CI and get build failed.

schnittstabil commented 8 years ago

You may try || true, which is perhaps not platform independent, though:

cpy 'public/**/*.*' '../build/' --cwd=src --parents || true
alexander-akait commented 8 years ago

@schnittstabil thanks

schnittstabil commented 8 years ago

The double pipe (||) is supported by windows, but not the true command afaik. For package.json/"scripts" use cases you may install a cross-platform implementation, e.g. cash-true:

npm install --save-dev cash-true