@@ -136,6 +136,23 @@ program.command('hub-version')
136136 }
137137 } ) ;
138138
139+ program . command ( 'hub-path' )
140+ . description ( 'Print the path to the Unity Hub executable.' )
141+ . option ( '--json' , 'Prints the last line of output as JSON string.' )
142+ . action ( async ( options ) => {
143+ const hub = new UnityHub ( ) ;
144+
145+ Logger . instance . CI_setEnvironmentVariable ( 'UNITY_HUB_PATH' , hub . executable ) ;
146+
147+ if ( options . json ) {
148+ process . stdout . write ( `\n${ JSON . stringify ( { UNITY_HUB_PATH : hub . executable } ) } \n` ) ;
149+ } else {
150+ process . stdout . write ( `${ hub . executable } \n` ) ;
151+ }
152+
153+ process . exit ( 0 ) ;
154+ } ) ;
155+
139156program . command ( 'hub-install' )
140157 . description ( 'Install the Unity Hub.' )
141158 . option ( '--verbose' , 'Enable verbose logging.' )
@@ -168,23 +185,6 @@ program.command('hub-install')
168185 process . exit ( 0 ) ;
169186 } ) ;
170187
171- program . command ( 'hub-path' )
172- . description ( 'Print the path to the Unity Hub executable.' )
173- . option ( '--json' , 'Prints the last line of output as JSON string.' )
174- . action ( async ( options ) => {
175- const hub = new UnityHub ( ) ;
176-
177- Logger . instance . CI_setEnvironmentVariable ( 'UNITY_HUB_PATH' , hub . executable ) ;
178-
179- if ( options . json ) {
180- process . stdout . write ( `\n${ JSON . stringify ( { UNITY_HUB_PATH : hub . executable } ) } \n` ) ;
181- } else {
182- process . stdout . write ( `${ hub . executable } \n` ) ;
183- }
184-
185- process . exit ( 0 ) ;
186- } ) ;
187-
188188program . command ( 'hub' )
189189 . description ( 'Run commands directly to the Unity Hub. (You need not to pass --headless or -- to this command).' )
190190 . allowUnknownOption ( true )
0 commit comments