-
Notifications
You must be signed in to change notification settings - Fork 1
/
checker.js
65 lines (49 loc) · 1.31 KB
/
checker.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env node
'use strict';
// let gitDir = "M:\Project\spring-cloud-alibaba\.git";
let dir = process.argv[2];
// console.log(dir);
if (dir === "--config")
{
const openExplorer = require('open-file-explorer');
openExplorer(__dirname, err => {
if(err)
{
console.log(err);
}
else
{
console.log("Config is in config.js");
}
});
}
else
{
let extensionName = dir.substr(dir.lastIndexOf('.'));
let getLogFunc;
if (extensionName === ".git")
{
getLogFunc = require("./get_git_log").getGitLog;
}
else if (extensionName === ".svn")
{
getLogFunc = require("./get_svn_log").getSvnLog;
dir = dir.substr(0, dir.length - 4);
}
else
{
console.error("path error : " + dir);
}
if (getLogFunc)
{
getLogFunc(dir, (logText)=>{
let text = "var _logData = [" + logText + "];";
let fs = require('fs');
let path = require('path');
fs.writeFileSync(path.join(__dirname, "log_data.js"), text);
// console.log("done");
let open = require('open');
open('file:///' + path.join(__dirname, 'index.html'));
});
}
}