Skip to content

Commit

Permalink
Don't write to stdout if no files exists
Browse files Browse the repository at this point in the history
  • Loading branch information
kevva committed May 16, 2016
1 parent 09ccff7 commit 0483df1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ const run = (input, opts) => {

imagemin(input, opts.outDir, {use})
.then(files => {
if (!opts.outDir && files.length === 0) {
return;
}

if (!opts.outDir && files.length > 1) {
console.error('Cannot write multiple files to stdout, specify a `--out-dir`');
process.exit(1);
Expand Down

0 comments on commit 0483df1

Please sign in to comment.