@@ -201,6 +201,7 @@ sudo apt-get install -y --no-install-recommends --only-upgrade unityhub`]);
201201 }
202202
203203 private async installHub ( ) : Promise < void > {
204+ this . logger . ci ( `Installing Unity Hub...` ) ;
204205 switch ( process . platform ) {
205206 case 'win32' : {
206207 const url = 'https://public-cdn.cloud.unity3d.com/hub/prod/UnityHubSetup.exe' ;
@@ -210,7 +211,7 @@ sudo apt-get install -y --no-install-recommends --only-upgrade unityhub`]);
210211 this . logger . info ( `Running Unity Hub installer...` ) ;
211212
212213 try {
213- await Exec ( downloadPath , [ '/S' ] , { silent : true } ) ;
214+ await Exec ( downloadPath , [ '/S' ] , { silent : true , showCommand : true } ) ;
214215 } finally {
215216 if ( fs . statSync ( downloadPath ) . isFile ( ) ) {
216217 await fs . promises . unlink ( downloadPath ) ;
@@ -223,7 +224,6 @@ sudo apt-get install -y --no-install-recommends --only-upgrade unityhub`]);
223224 const baseUrl = 'https://public-cdn.cloud.unity3d.com/hub/prod' ;
224225 const url = `${ baseUrl } /UnityHubSetup-${ process . arch } .dmg` ;
225226 const downloadPath = path . join ( GetTempDir ( ) , `UnityHubSetup-${ process . arch } .dmg` ) ;
226- this . logger . info ( `Downloading Unity Hub from ${ url } to ${ downloadPath } ` ) ;
227227
228228 await DownloadFile ( url , downloadPath ) ;
229229 await fs . promises . chmod ( downloadPath , 0o777 ) ;
@@ -232,7 +232,7 @@ sudo apt-get install -y --no-install-recommends --only-upgrade unityhub`]);
232232 this . logger . debug ( `Mounting DMG...` ) ;
233233
234234 try {
235- const output = await Exec ( 'hdiutil' , [ 'attach' , downloadPath , '-nobrowse' ] , { silent : true } ) ;
235+ const output = await Exec ( 'hdiutil' , [ 'attach' , downloadPath , '-nobrowse' ] , { silent : true , showCommand : true } ) ;
236236 // can be "/Volumes/Unity Hub 3.13.1-arm64" or "/Volumes/Unity Hub 3.13.1"
237237 const mountPointMatch = output . match ( / \/ V o l u m e s \/ U n i t y H u b .* $ / m) ;
238238
@@ -248,16 +248,16 @@ sudo apt-get install -y --no-install-recommends --only-upgrade unityhub`]);
248248
249249 await fs . promises . access ( appPath , fs . constants . R_OK | fs . constants . X_OK ) ;
250250 if ( fs . existsSync ( '/Applications/Unity Hub.app' ) ) {
251- await Exec ( 'sudo' , [ 'rm' , '-rf' , '/Applications/Unity Hub.app' ] , { silent : true } ) ;
251+ await Exec ( 'sudo' , [ 'rm' , '-rf' , '/Applications/Unity Hub.app' ] , { silent : true , showCommand : true } ) ;
252252 }
253- await Exec ( 'sudo' , [ 'cp' , '-R' , appPath , '/Applications/Unity Hub.app' ] , { silent : true } ) ;
254- await Exec ( 'sudo' , [ 'chmod' , '777' , '/Applications/Unity Hub.app/Contents/MacOS/Unity Hub' ] , { silent : true } ) ;
255- await Exec ( 'sudo' , [ 'mkdir' , '-p' , '/Library/Application Support/Unity' ] , { silent : true } ) ;
256- await Exec ( 'sudo' , [ 'chmod' , '777' , '/Library/Application Support/Unity' ] , { silent : true } ) ;
253+ await Exec ( 'sudo' , [ 'cp' , '-R' , appPath , '/Applications/Unity Hub.app' ] , { silent : true , showCommand : true } ) ;
254+ await Exec ( 'sudo' , [ 'chmod' , '777' , '/Applications/Unity Hub.app/Contents/MacOS/Unity Hub' ] , { silent : true , showCommand : true } ) ;
255+ await Exec ( 'sudo' , [ 'mkdir' , '-p' , '/Library/Application Support/Unity' ] , { silent : true , showCommand : true } ) ;
256+ await Exec ( 'sudo' , [ 'chmod' , '777' , '/Library/Application Support/Unity' ] , { silent : true , showCommand : true } ) ;
257257 } finally {
258258 try {
259259 if ( mountPoint && mountPoint . length > 0 ) {
260- await Exec ( 'hdiutil' , [ 'detach' , mountPoint , '-quiet' ] , { silent : true } ) ;
260+ await Exec ( 'hdiutil' , [ 'detach' , mountPoint , '-quiet' ] , { silent : true , showCommand : true } ) ;
261261 }
262262 } finally {
263263 if ( fs . statSync ( downloadPath ) . isFile ( ) ) {
@@ -295,7 +295,7 @@ chmod -R 777 "$hubPath"`]);
295295 }
296296
297297 await fs . promises . access ( this . executable , fs . constants . X_OK ) ;
298- this . logger . info ( `Unity Hub installed successfully. ` ) ;
298+ this . logger . debug ( `Unity Hub install complete ` ) ;
299299 }
300300
301301 private async getInstalledHubVersion ( ) : Promise < SemVer > {
861861 this . logger . info ( `Running Unity ${ unityVersion . toString ( ) } installer...` ) ;
862862
863863 try {
864- await Exec ( installerPath , [ '/S' , `/D=${ installPath } ` , '-Wait' , '-NoNewWindow' ] , { silent : true } ) ;
864+ await Exec ( installerPath , [ '/S' , `/D=${ installPath } ` , '-Wait' , '-NoNewWindow' ] , { silent : true , showCommand : true } ) ;
865865 } catch ( error ) {
866866 this . logger . error ( `Failed to install Unity ${ unityVersion . toString ( ) } : ${ error } ` ) ;
867867 } finally {
885885 let mountPoint = '' ;
886886
887887 try {
888- const output = await Exec ( 'hdiutil' , [ 'attach' , installerPath , '-nobrowse' ] , { silent : true } ) ;
888+ const output = await Exec ( 'hdiutil' , [ 'attach' , installerPath , '-nobrowse' ] , { silent : true , showCommand : true } ) ;
889889 const mountPointMatch = output . match ( / \/ V o l u m e s \/ U n i t y I n s t a l l e r .* $ / m) ;
890890
891891 if ( ! mountPointMatch || mountPointMatch . length === 0 ) {
899899 await fs . promises . access ( pkgPath , fs . constants . R_OK ) ;
900900
901901 this . logger . debug ( `Found .pkg installer: ${ pkgPath } ` ) ;
902- await Exec ( 'sudo' , [ 'installer' , '-pkg' , pkgPath , '-target' , '/' , '-verboseR' ] , { silent : true } ) ;
902+ await Exec ( 'sudo' , [ 'installer' , '-pkg' , pkgPath , '-target' , '/' , '-verboseR' ] , { silent : true , showCommand : true } ) ;
903903 const unityAppPath = path . join ( '/Applications' , 'Unity' ) ;
904904 const targetPath = path . join ( installDir , `Unity ${ unityVersion . version } ` ) ;
905905
928928 } finally {
929929 try {
930930 if ( mountPoint && mountPoint . length > 0 ) {
931- await Exec ( 'hdiutil' , [ 'detach' , mountPoint , '-quiet' ] , { silent : true } ) ;
931+ await Exec ( 'hdiutil' , [ 'detach' , mountPoint , '-quiet' ] , { silent : true , showCommand : true } ) ;
932932 }
933933 } finally {
934934 await fs . promises . unlink ( installerPath ) ;
0 commit comments