drizzle-auto 1.1.23 → 1.1.24
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/index.js +10 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* 🌟 Drizzle-Auto v2 -
|
|
4
|
+
* 🌟 Drizzle-Auto v2 - Fail-Fast Version
|
|
5
|
+
* 🔹 Stops immediately on any error
|
|
5
6
|
* 🔹 Strict config: drizzle.config.js / ts / mjs / cjs
|
|
6
|
-
* 🔹
|
|
7
|
-
* 🔹 Full error
|
|
7
|
+
* 🔹 Watcher disabled on --postinstall
|
|
8
|
+
* 🔹 Full error catching
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
|
-
const {
|
|
11
|
+
const { spawn } = require("child_process");
|
|
11
12
|
const path = require("path");
|
|
12
13
|
const fs = require("fs");
|
|
13
14
|
|
|
14
|
-
// Optional
|
|
15
|
+
// Optional TS support
|
|
15
16
|
try { require("ts-node").register({ transpileOnly: true }); } catch(e){}
|
|
16
17
|
|
|
17
18
|
// ---------------------- COLORS ----------------------
|
|
@@ -132,7 +133,7 @@ async function triggerEngine(){
|
|
|
132
133
|
if(!audit.ok){
|
|
133
134
|
console.log(`${T.red}${T.bold}👾 CRITICAL FAILURE:${T.reset} ${audit.msg}`);
|
|
134
135
|
running = false;
|
|
135
|
-
|
|
136
|
+
process.exit(1); // <- stop immediately
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
const steps = [
|
|
@@ -148,6 +149,7 @@ async function triggerEngine(){
|
|
|
148
149
|
console.log(`${T.lime}${T.bold}🎉 All steps successful!${T.reset}`);
|
|
149
150
|
} catch(err){
|
|
150
151
|
console.log(`${T.red}🚨 ERROR: ${err.message}${T.reset}`);
|
|
152
|
+
process.exit(1); // <- stop immediately on any error
|
|
151
153
|
}
|
|
152
154
|
|
|
153
155
|
running = false;
|
|
@@ -175,8 +177,8 @@ if(!skipWatcher){
|
|
|
175
177
|
|
|
176
178
|
// ---------------------- GLOBAL ERROR HANDLING ----------------------
|
|
177
179
|
process.on("uncaughtException", err=>{
|
|
178
|
-
console.log(`${T.red}${T.bold}🛡️ ERROR:${T.reset} ${err.message}`);
|
|
179
|
-
|
|
180
|
+
console.log(`${T.red}${T.bold}🛡️ UNCAUGHT ERROR:${T.reset} ${err.message}`);
|
|
181
|
+
process.exit(1); // <- stop immediately
|
|
180
182
|
});
|
|
181
183
|
|
|
182
184
|
process.on("SIGINT", ()=>{
|