crabatool 1.0.361 → 1.0.364
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/lib/server.js +7 -2
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -11,11 +11,12 @@ exports = module.exports;
|
|
|
11
11
|
// 每次都重启server
|
|
12
12
|
var aloneServer;
|
|
13
13
|
exports.run = function(options) {
|
|
14
|
+
var that = this;
|
|
14
15
|
if (aloneServer) {
|
|
15
16
|
aloneServer.close(() => {
|
|
16
17
|
console.log('关闭旧实例...');
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
that.start(options);
|
|
19
20
|
});
|
|
20
21
|
} else {
|
|
21
22
|
this.start(options);
|
|
@@ -142,7 +143,11 @@ function createServer(app, options) {
|
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
utils.log(`Server running at ${url}`);
|
|
145
|
-
|
|
146
|
+
var noOpen = config.noOpen;
|
|
147
|
+
if (options) {
|
|
148
|
+
noOpen = options.noOpen;
|
|
149
|
+
}
|
|
150
|
+
if (!noOpen) {
|
|
146
151
|
utils.openProcess(url);
|
|
147
152
|
}
|
|
148
153
|
});
|