-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblank.js
48 lines (42 loc) · 1.14 KB
/
blank.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
"use strict";
const minimist = require("minimist");
const argv = minimist(process.argv.slice(2));
const help = argv.help || argv.h;
const configPath = argv.dir || argv.d || process.cwd();
const watch = argv.watch || argv.w || false;
const token = argv.token || false;
const force = argv.force || argv.f;
if (help) {
require("./help");
}
const blankJson = require("./blankJson");
blankJson.read(configPath);
switch (argv._[0]) {
case "server":
require("./server")(false);
break;
case "one":
if (!process.env.BLANK_SERVICE_REGISTRY_PORT) {
process.env.BLANK_SERVICE_REGISTRY_PORT = "2345";
}
require("./server")(true);
break;
case "init":
require("./init")(argv._[1], force);
break;
case "version":
require("./version")();
break;
case "test":
require("./testRunner")(configPath);
break;
case "publish":
require("./publish")(configPath, token);
break;
case "dist":
require("./webpackCompile")(configPath);
break;
default:
require("./buildConfig")(configPath, watch);
break;
}