lovell / avif-cli

Command line utility to convert images to AVIF
Apache License 2.0
175 stars 18 forks source link

Wrong exit code, when no file was created #16

Closed dgsiegel closed 11 months ago

dgsiegel commented 11 months ago

I am running avif-cli like this: avif --input='img/*.{jpg,jpeg,png}' --quality 64 --verbose. This works fine, when at least one image will be converted. When all images already have been converted and --overwrite has not been set, avif will return with a status of 1 which will be interpreted as failure.

The culprit seems to be this line, which returns undefined in this case.

https://github.com/lovell/avif-cli/blob/main/lib/convert.js#L33

Changing it for example to return true would fix this issue.

lovell commented 11 months ago

Thanks for reporting, a PR with this fix would be most welcome, if you're able.

dgsiegel commented 11 months ago

Thanks for reporting, a PR with this fix would be most welcome, if you're able.

Sure thing: https://github.com/lovell/avif-cli/pull/17

lovell commented 11 months ago

v0.5.1 now available with your fix, thank you.