File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 22import fs from 'node:fs' ;
33import path from 'node:path' ;
44import process from 'node:process' ;
5+ import { createRequire } from 'node:module' ;
56import { TerminalAdapter } from '@yeoman/adapter' ;
67import chalk from 'chalk' ;
78import updateNotifier from 'update-notifier' ;
@@ -42,6 +43,12 @@ const cli = generators.map(generator => {
4243const firstCmd = cli [ 0 ] || { opts : { } , args : { } } ;
4344const 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+
4552function updateCheck ( ) {
4653 const notifier = updateNotifier ( { pkg} ) ;
4754 const message = [ ] ;
You can’t perform that action at this time.
0 commit comments