forked from a597873885/webfunny_monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtable_config.js
More file actions
22 lines (22 loc) · 748 Bytes
/
table_config.js
File metadata and controls
22 lines (22 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var fs = require('fs');
const utils = require('./util/utils')
const log = require("./config/log");
var argv = process.argv
var commandLine = ""
var start = 0
var end = argv[2]
for (var i = start; i < end; i ++) {
var dataStr = utils.addDays(i).replace(/-/g, "")
if (i == end - 1) {
commandLine += "node " + "table_create.js " + dataStr + " "
} else {
commandLine += "node " + "table_create.js " + dataStr + " && "
}
}
fs.readFile('./package.json', function(err, data){
let newString = data.toString().replace(/table_create_command/g, commandLine)
fs.writeFile('./package.json', newString, (err) => {
if (err) throw err;
log.printInfo("命令配置完成, 请执行命令: npm run table_create");
});
})