diff --git a/package.json b/package.json index 8781495..6a508d1 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ ], "scripts": { "build": "tsc --project tsconfig.json", - "gember": "bin/gember.js --path=test/output", + "gember": "GEMBER_PATH=test/output bin/gember.js", "lint": "concurrently --group --prefix-colors auto \"npm:lint:*(!fix)\"", "lint:fix": "concurrently --group --prefix-colors auto \"npm:lint:*:fix\"", "lint:format": "prettier . --cache --check", diff --git a/src/generator.ts b/src/generator.ts index d8e4383..1d9f766 100644 --- a/src/generator.ts +++ b/src/generator.ts @@ -4,7 +4,7 @@ import { ensureDir, pathExists, readJson } from "fs-extra/esm"; import Handlebars from "handlebars"; import { readFile, writeFile } from "node:fs/promises"; import { dirname, join, relative } from "node:path"; -import { cwd } from "node:process"; +import { cwd, env } from "node:process"; import { fileURLToPath } from "node:url"; import { resolveConfig, type Config } from "./config.js"; import { FileReference } from "./file-reference.js"; @@ -85,7 +85,7 @@ export function defineGenerator({ ext: ".ts", name: entityName, rootDir: packagePath, - subDir: entityPath ?? "", + subDir: entityPath ?? env.GEMBER_PATH ?? "", }); const templateFile = new FileReference({