use home dir for init

This commit is contained in:
grngxd 2025-06-24 16:07:02 +01:00
parent f724fc0ecb
commit eac55e01c5
5 changed files with 45 additions and 11 deletions

17
lib.ts Normal file
View file

@ -0,0 +1,17 @@
export const environment: "prod" | "dev" = (() => {
const arg1 = process.argv[1] || "";
if (arg1.includes("bunx")) return "prod";
if (
arg1.includes(".bun\\install\\global") ||
arg1.includes(".bun/install/global")
) {
return "prod";
}
return "dev";
})();
export const isProd = environment === "prod";
export const isDev = environment === "dev";