drizzle-auto 1.1.17 → 1.1.18

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.
Files changed (2) hide show
  1. package/index.js +13 -6
  2. package/package.json +4 -3
package/index.js CHANGED
@@ -55,16 +55,23 @@ function stopLoading(){
55
55
  /* =============================================================
56
56
  🧩 AUTO SCRIPT INJECTOR
57
57
  ============================================================= */
58
- const PKG = path.join(process.cwd(),"package.json");
59
- function injectScript(){
60
- if(!fs.existsSync(PKG)) return;
61
- const pkg = JSON.parse(fs.readFileSync(PKG,"utf8"));
58
+ const PKG = path.join(process.cwd(), "package.json");
59
+ function injectScript() {
60
+ if (!fs.existsSync(PKG)) return;
61
+ const pkg = JSON.parse(fs.readFileSync(PKG, "utf8"));
62
62
  pkg.scripts ||= {};
63
- if(!pkg.scripts.drizzle){
63
+
64
+ // Add both scripts if missing
65
+ if (!pkg.scripts.drizzle) {
64
66
  pkg.scripts.drizzle = "drizzle-auto";
65
- fs.writeFileSync(PKG, JSON.stringify(pkg,null,2));
66
67
  console.log(`${T.lime}☕ Script added → npm/yarn/pnpm run drizzle${T.reset}`);
67
68
  }
69
+ if (!pkg.scripts.tea) {
70
+ pkg.scripts.tea = "drizzle-auto";
71
+ console.log(`${T.lime}🍵 Script added → npm/yarn/pnpm run tea${T.reset}`);
72
+ }
73
+
74
+ fs.writeFileSync(PKG, JSON.stringify(pkg, null, 2));
68
75
  }
69
76
  injectScript();
70
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-auto",
3
- "version": "1.1.17",
3
+ "version": "1.1.18",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "pavel ahmmed hridoy",
@@ -11,11 +11,12 @@
11
11
  },
12
12
  "scripts": {
13
13
  "postinstall": "node index.js --postinstall",
14
- "tea": "node index.js"
14
+ "tea": "node index.js",
15
+ "drizzle": "drizzle-auto"
15
16
  },
16
17
  "dependencies": {
17
18
  "chokidar": "^5.0.0",
18
19
  "cross-spawn": "^7.0.6"
19
20
  },
20
21
  "devDependencies": {}
21
- }
22
+ }