Comparing version 0.0.2 to 0.0.3
@@ -62,3 +62,3 @@ var fs = require('fs-extra'), | ||
var imageChunk = path.join(filepath, indexedImages.src.length + '.png'); | ||
var imageChunk = path.join(filepath, 'ref_' + indexedImages.src.length + '.png'); | ||
@@ -106,4 +106,4 @@ fs.outputFileSync(imageChunk, image); | ||
if (cache && cache.src.length > 1) { | ||
var a = cache.src.length - 2, | ||
if (cache && ((cache.src.length > 1) || options.ref)) { | ||
var a = options.ref ? '_ref' : ('ref_' + (cache.src.length - 2)), | ||
b = cache.src.length - 1; | ||
@@ -113,4 +113,4 @@ | ||
latest: path.join(cache.filepath, a + '.png'), | ||
current: path.join(cache.filepath, b + '.png'), | ||
filepathDiff: path.join(cache.filepath, a + '_' + b + '.png') | ||
current: path.join(cache.filepath, 'ref_' + b + '.png'), | ||
filepathDiff: path.join(cache.filepath, 'ref_' + a + '_' + b + '.png') | ||
}; | ||
@@ -136,3 +136,3 @@ } | ||
if (!diffImages) { | ||
if (!(diffImages && fs.existsSync(diffImages.latest) && fs.existsSync(diffImages.current))) { | ||
return cb(); | ||
@@ -139,0 +139,0 @@ } |
{ | ||
"name": "dayguard", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
4820