Skip to content

Commit

Permalink
Only show actually compressed images in success message (#266)
Browse files Browse the repository at this point in the history
Fixes #251.
  • Loading branch information
kevva authored and sindresorhus committed May 30, 2017
1 parent 7ade8b6 commit f119bfe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ module.exports = (plugins, opts) => {
const savedMsg = `saved ${prettyBytes(saved)} - ${percent.toFixed(1).replace(/\.0$/, '')}%`;
const msg = saved > 0 ? savedMsg : 'already optimized';

totalBytes += originalSize;
totalSavedBytes += saved;
totalFiles++;
if (saved > 0) {
totalBytes += originalSize;
totalSavedBytes += saved;
totalFiles++;
}

if (opts.verbose) {
gutil.log('gulp-imagemin:', chalk.green('✔ ') + file.relative + chalk.gray(` (${msg})`));
Expand Down

0 comments on commit f119bfe

Please sign in to comment.