-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunCheck.js
43 lines (31 loc) · 1.02 KB
/
runCheck.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const FileUtil= require('./lib/FileUtil');
const ImageUtil= require('./lib/ImageUtil');
const SlackUtil= require('./lib/SlackUtil');
let s = new SlackUtil();
let fu = new FileUtil();
let base = process.argv[2];
let baseDiff = process.argv[3];
var dirs = fu.getLS(base).split('\n');
var diffdir = baseDiff;
fu.createPath(baseDiff);
fu.createPath(diffdir);
var ret = fu.getAllFiles(base+'/'+dirs[0]);
( async () => {
let i = new ImageUtil();
var ary = [];
await s.postText('check START');
await s.postText(ret.length+' files '+dirs[0] );
let diff = ( async (filename,baseDir,compareDir) => {
var diffB = filename.replace(baseDir,compareDir);
ret = await i.imageDiff(
filename,
diffB,
diffdir,
(async (file,misMatchPercentage) =>{
console.log(misMatchPercentage+','+file);
})
);
})
ret.forEach(async (filename) => await diff(filename,dirs[0],dirs[1]));
await s.postText('check END');
})();