Skip to content

Commit 03aacf4

Browse files
committed
no-mistakes(review): Guard engine-version stamp to persistent gen-state only
1 parent 1b40e7e commit 03aacf4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • server/typescript/packages/codegen-ts/src

‎server/typescript/packages/codegen-ts/src/runner.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ export async function runGen(opts: RunGenOpts): Promise<RunGenResult> {
100100
// since the last gen, note it (generated output may legitimately differ). Purely
101101
// informational — the version file is separate from `.hashes.json` and never
102102
// affects the merge. Only fires when a prior stamp exists AND differs.
103-
const installedEngine = engineVersion();
104-
const recordedEngine = loadEngineVersion(genStateDir);
103+
const hasPersistentGenState = opts.projectRoot !== undefined || opts.genStateDir !== undefined;
104+
const installedEngine = hasPersistentGenState ? engineVersion() : undefined;
105+
const recordedEngine = hasPersistentGenState ? loadEngineVersion(genStateDir) : undefined;
105106
if (
106107
installedEngine !== undefined &&
107108
recordedEngine !== undefined &&

0 commit comments

Comments
 (0)