Skip to content

Commit 5abbd16

Browse files
committed
chore: add --environment-version option
1 parent 4830565 commit 5abbd16

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/cli.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import fs from 'node:fs';
33
import path from 'node:path';
44
import process from 'node:process';
5+
import {createRequire} from 'node:module';
56
import {TerminalAdapter} from '@yeoman/adapter';
67
import chalk from 'chalk';
78
import updateNotifier from 'update-notifier';
@@ -42,6 +43,12 @@ const cli = generators.map(generator => {
4243
const firstCmd = cli[0] || {opts: {}, args: {}};
4344
const cmd = firstCmd.args[0];
4445

46+
if (firstCmd.opts.environmentVersion) {
47+
const envPackageJson = createRequire(import.meta.url)('yeoman-environment/package.json');
48+
console.log(envPackageJson.version);
49+
process.exit(0);
50+
}
51+
4552
function updateCheck() {
4653
const notifier = updateNotifier({pkg});
4754
const message = [];

0 commit comments

Comments
 (0)