-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.js
executable file
·36 lines (30 loc) · 1.14 KB
/
start.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
#!/usr/bin/env node
const child_process = require("child_process");
const path = require("path");
const updateNotifier = require("update-notifier");
const pkg = require("./package.json");
const { ErrorMessage, SuccessMessage } = require("./scripts/helper");
const notifier = updateNotifier({
pkg,
updateCheckInterval: 1000 * 60 * 60 * 24,
});
if (notifier.update && notifier.update.latest !== pkg.version) {
const old = notifier.update.current;
const latest = notifier.update.latest;
var message =
`${SuccessMessage("New")} version of ${SuccessMessage(
pkg.name,
)} available! ${ErrorMessage(old)} -> ${SuccessMessage(latest)}\n` +
`Run ${SuccessMessage(`npm install -g ${pkg.name}`)} to update!`;
notifier.notify({ message: message });
console.log("______________________________________________________________");
console.log(message);
console.log("______________________________________________________________");
}
var args = process.argv.slice(2);
var dirName = args[0];
var end_to_end = args[1];
var p = path.join(__dirname, "scripts/create.js");
child_process.execSync(`node ${p} ${dirName} ${end_to_end}`, {
stdio: "inherit",
});