Skip to content

Commit 72b3b2c

Browse files
authored
Merge pull request #79 from bertdeblock/fix-generating-files-during-dev
Fix generating files during development
2 parents 2480ff9 + 6bfa46d commit 72b3b2c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"scripts": {
2525
"build": "tsc --project tsconfig.json",
26-
"gember": "bin/gember.js --path=test/output",
26+
"gember": "GEMBER_PATH=test/output bin/gember.js",
2727
"lint": "concurrently --group --prefix-colors auto \"npm:lint:*(!fix)\"",
2828
"lint:fix": "concurrently --group --prefix-colors auto \"npm:lint:*:fix\"",
2929
"lint:format": "prettier . --cache --check",

src/generator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ensureDir, pathExists, readJson } from "fs-extra/esm";
44
import Handlebars from "handlebars";
55
import { readFile, writeFile } from "node:fs/promises";
66
import { dirname, join, relative } from "node:path";
7-
import { cwd } from "node:process";
7+
import { cwd, env } from "node:process";
88
import { fileURLToPath } from "node:url";
99
import { resolveConfig, type Config } from "./config.js";
1010
import { FileReference } from "./file-reference.js";
@@ -85,7 +85,7 @@ export function defineGenerator({
8585
ext: ".ts",
8686
name: entityName,
8787
rootDir: packagePath,
88-
subDir: entityPath ?? "",
88+
subDir: entityPath ?? env.GEMBER_PATH ?? "",
8989
});
9090

9191
const templateFile = new FileReference({

0 commit comments

Comments
 (0)