We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 683bf8a commit 9066017Copy full SHA for 9066017
src/plugins.ts
@@ -180,16 +180,16 @@ export const initPlugin = (
180
imgDiff,
181
maxDiffThreshold: cfg.maxDiffThreshold,
182
};
183
+ } else {
184
+ // don't overwrite file if it's the same (imgDiff < cfg.maxDiffThreshold && !isImgSizeDifferent)
185
+ fs.unlinkSync(cfg.imgNew);
186
}
-
- fs.unlinkSync(cfg.imgOld);
187
} else {
188
// there is no "old screenshot" or screenshots should be immediately updated
189
imgDiff = 0;
190
+ moveFile.sync(cfg.imgNew, cfg.imgOld);
191
192
- moveFile.sync(cfg.imgNew, cfg.imgOld);
193
if (typeof imgDiff !== "undefined") {
194
const roundedImgDiff = Math.ceil(imgDiff * 1000) / 1000;
195
return {
0 commit comments