not-node 6.3.71 → 6.3.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/const.js +13 -0
- package/src/init/lib/env.js +28 -5
package/package.json
CHANGED
package/src/const.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const DEFAULT_PATH_TMP = "../../tmp";
|
|
2
|
+
const DEFAULT_PATH_STATIC = "../static";
|
|
3
|
+
const DEFAULT_PATH_MODULES = "./modules";
|
|
4
|
+
const DEFAULT_PATH_WS = "./ws";
|
|
5
|
+
const DEFAULT_PATH_DB_DUMPS = "../../db.dumps";
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
DEFAULT_PATH_WS,
|
|
9
|
+
DEFAULT_PATH_MODULES,
|
|
10
|
+
DEFAULT_PATH_STATIC,
|
|
11
|
+
DEFAULT_PATH_TMP,
|
|
12
|
+
DEFAULT_PATH_DB_DUMPS,
|
|
13
|
+
};
|
package/src/init/lib/env.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
const log = require("not-log")(module, "not-node//init//env");
|
|
2
2
|
const { tryDirAsync } = require("../../common");
|
|
3
|
+
const {
|
|
4
|
+
DEFAULT_PATH_WS,
|
|
5
|
+
DEFAULT_PATH_MODULES,
|
|
6
|
+
DEFAULT_PATH_STATIC,
|
|
7
|
+
DEFAULT_PATH_TMP,
|
|
8
|
+
DEFAULT_PATH_DB_DUMPS,
|
|
9
|
+
} = require("../../const");
|
|
3
10
|
|
|
4
11
|
module.exports = class InitENV {
|
|
5
12
|
static getProxyPort(config) {
|
|
@@ -39,24 +46,40 @@ module.exports = class InitENV {
|
|
|
39
46
|
await emit("env.pre", { config, options, master });
|
|
40
47
|
config.set(
|
|
41
48
|
"staticPath",
|
|
42
|
-
master.getAbsolutePath(
|
|
49
|
+
master.getAbsolutePath(
|
|
50
|
+
config.get("path:static", DEFAULT_PATH_STATIC)
|
|
51
|
+
)
|
|
43
52
|
);
|
|
44
53
|
config.set(
|
|
45
54
|
"modulesPath",
|
|
46
|
-
master.getAbsolutePath(
|
|
55
|
+
master.getAbsolutePath(
|
|
56
|
+
config.get("path:modules", DEFAULT_PATH_MODULES)
|
|
57
|
+
)
|
|
47
58
|
);
|
|
59
|
+
|
|
60
|
+
config.set(
|
|
61
|
+
"tmpPath",
|
|
62
|
+
master.getAbsolutePath(config.get("path:tmp", DEFAULT_PATH_TMP))
|
|
63
|
+
);
|
|
64
|
+
|
|
48
65
|
config.set(
|
|
49
66
|
"dbDumpsPath",
|
|
50
67
|
master.getAbsolutePath(
|
|
51
|
-
config.get("path:dbDumps")
|
|
68
|
+
config.get("path:dbDumps", DEFAULT_PATH_DB_DUMPS)
|
|
52
69
|
)
|
|
53
70
|
);
|
|
54
71
|
config.set("appPath", options.pathToApp);
|
|
55
72
|
config.set("npmPath", options.pathToNPM);
|
|
56
73
|
config.set("fullServerName", InitENV.getFullServerName(config));
|
|
57
74
|
if (config.get("path:ws")) {
|
|
58
|
-
log?.log(
|
|
59
|
-
|
|
75
|
+
log?.log(
|
|
76
|
+
"wsPath",
|
|
77
|
+
master.getAbsolutePath(config.get("path:ws", DEFAULT_PATH_WS))
|
|
78
|
+
);
|
|
79
|
+
config.set(
|
|
80
|
+
"wsPath",
|
|
81
|
+
master.getAbsolutePath(config.get("path:ws", DEFAULT_PATH_WS))
|
|
82
|
+
);
|
|
60
83
|
}
|
|
61
84
|
await InitENV.checkPaths(master, config);
|
|
62
85
|
await emit("env.post", { config, options, master });
|