-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.js
41 lines (34 loc) · 1.27 KB
/
vue.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
const fs = require('fs');
const ownFs = require('./files');
const range = require('./range');
const calc = require('./calc');
async function start() {
const content = {
mdFiles: ownFs.getRootMdFiles('../vue'),
otherFiles: [],
name: 'vue',
owner: 'vuejs',
username: 'yyx990803',
};
const directories = ['../vue'];
directories.forEach((dir) => {
ownFs.findFiles(dir, content);
});
fs.writeFileSync('./vue/files.json', JSON.stringify(content, null, 2), 'utf8')
const ranges = await range.getRangeContent(content, '../vue/')
return fs.writeFileSync('./vue/range.json', JSON.stringify(ranges, null, 2), 'utf8')
}
function compare() {
const content = JSON.parse(fs.readFileSync('./vue/files.json'));
const ranges = JSON.parse(fs.readFileSync('./vue/range.json'));
const result = {};
result.mdFiles = ownFs.compareMdFiles(content.mdFiles, ranges.mdFiles);
const compareFiles = ownFs.compareOtherFiles(content.otherFiles, ranges.otherFiles);
result.otherFiles = compareFiles.otherFiles;
fs.writeFileSync('./vue/quality.json', JSON.stringify(compareFiles.hasQuality, null, 2), 'utf8')
// fs.writeFileSync('./vue/compare.json', JSON.stringify(result, null, 2), 'utf8')
// calc.calc(result, './vue');
}
// start().then(() => {
compare();
// });