sindresorhus/cpy-cli

option for ignore error if not found files

Closed this issue · 5 comments

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/**/*.*'

@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?

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

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

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

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