From a38841a5872deaa2b8778d43617ccc152a184b4f Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Sat, 21 Mar 2026 13:52:53 +0100 Subject: [PATCH] Major Bugfix. Update init function --- dist/functions/init.js | 3 +-- package.json | 2 +- src/functions/init.ts | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dist/functions/init.js b/dist/functions/init.js index 2eaab82..d2ecaf8 100644 --- a/dist/functions/init.js +++ b/dist/functions/init.js @@ -3,10 +3,9 @@ import grabDirNames from "../utils/grab-dir-names"; import { execSync } from "child_process"; import path from "path"; import grabConfig from "./grab-config"; -import isDevelopment from "../utils/is-development"; export default async function () { const dirNames = grabDirNames(); - const is_dev = isDevelopment(); + const is_dev = !Boolean(process.env.NODE_ENV == "production"); execSync(`rm -rf ${dirNames.BUNEXT_CACHE_DIR}`); execSync(`rm -rf ${dirNames.BUNX_CWD_MODULE_CACHE_DIR}`); try { diff --git a/package.json b/package.json index 05389a0..f0e7973 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ ], "scripts": { "dev": "tsc --watch", - "publish": "tsc --noEmit && tsc && git add . && git commit -m 'Bugfixes: update types, update imports, update init function.' && git push", + "git:push": "bun run test && tsc --noEmit && tsc && git add . && git commit -m 'Major Bugfix. Update init function' && git push", "compile": "bun build ./src/commands/index.ts --compile --outfile bin/bunext", "build": "tsc", "test": "bun test --max-concurrency=1" diff --git a/src/functions/init.ts b/src/functions/init.ts index d65bb03..cb2d03b 100644 --- a/src/functions/init.ts +++ b/src/functions/init.ts @@ -4,11 +4,10 @@ import { execSync } from "child_process"; import path from "path"; import grabConfig from "./grab-config"; import type { BunextConfig } from "../types"; -import isDevelopment from "../utils/is-development"; export default async function () { const dirNames = grabDirNames(); - const is_dev = isDevelopment(); + const is_dev = !Boolean(process.env.NODE_ENV == "production"); execSync(`rm -rf ${dirNames.BUNEXT_CACHE_DIR}`); execSync(`rm -rf ${dirNames.BUNX_CWD_MODULE_CACHE_DIR}`);