@absolutejs/absolute 0.13.1 → 0.13.2
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/dist/cli/index.js +8 -9
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -52,23 +52,22 @@ var dev = async (serverEntry) => {
|
|
|
52
52
|
stderr: "inherit"
|
|
53
53
|
});
|
|
54
54
|
let cleaning = false;
|
|
55
|
-
const cleanup = async () => {
|
|
55
|
+
const cleanup = async (exitCode2 = 0) => {
|
|
56
56
|
if (cleaning)
|
|
57
57
|
return;
|
|
58
58
|
cleaning = true;
|
|
59
|
-
|
|
59
|
+
try {
|
|
60
|
+
server.kill();
|
|
61
|
+
} catch {}
|
|
60
62
|
await server.exited;
|
|
61
63
|
if (scripts)
|
|
62
64
|
await stopDatabase(scripts);
|
|
63
|
-
process.exit(
|
|
65
|
+
process.exit(exitCode2);
|
|
64
66
|
};
|
|
65
|
-
process.on("SIGINT", cleanup);
|
|
66
|
-
process.on("SIGTERM", cleanup);
|
|
67
|
+
process.on("SIGINT", () => cleanup(0));
|
|
68
|
+
process.on("SIGTERM", () => cleanup(0));
|
|
67
69
|
const exitCode = await server.exited;
|
|
68
|
-
|
|
69
|
-
await stopDatabase(scripts);
|
|
70
|
-
if (!cleaning)
|
|
71
|
-
process.exit(exitCode);
|
|
70
|
+
await cleanup(exitCode);
|
|
72
71
|
};
|
|
73
72
|
var command = process.argv[2];
|
|
74
73
|
if (command === "dev") {
|
package/package.json
CHANGED