Skip to content

Commit 51cf315

Browse files
author
unknown
committed
fix(codegen): use getPackageJson for --version instead of hardcoded '0.0.1'
Uses getPackageJson(__dirname) from inquirerer to read the actual package.json version at runtime, matching the pattern used by cnc and pgpm CLIs.
1 parent 64cb55d commit 51cf315

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

graphql/codegen/src/core/codegen/templates/cli-entry.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
* Any changes here will affect all generated CLI entry points.
99
*/
1010

11-
import { CLI, CLIOptions } from 'inquirerer';
11+
import { CLI, CLIOptions, getPackageJson } from 'inquirerer';
1212
import { commands } from './commands';
1313

1414
if (process.argv.includes('--version') || process.argv.includes('-v')) {
15-
console.log('0.0.1');
15+
const pkg = getPackageJson(__dirname);
16+
console.log(pkg.version);
1617
process.exit(0);
1718
}
1819

0 commit comments

Comments
 (0)