File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,17 @@ import process from 'process';
44
55export type UnityInstallations = Record < string , string > ;
66
7- const programFiles = process . env . ProgramFiles || path . resolve ( "C:/Program Files/" ) ;
8- const unityHubPath = process . env . UnityHub || path . join ( programFiles , "Unity Hub" , "Unity Hub.exe" )
7+ const getUnityHubPath = ( ) => {
8+ switch ( process . platform ) {
9+ case "win32" : {
10+ const programFiles = process . env . ProgramFiles || "C:/Program Files" ;
11+ return path . resolve ( programFiles , "Unity Hub/Unity Hub.exe" ) ;
12+ }
13+ default : return "/Applications/Unity Hub.app/Contents/MacOS/Unity Hub"
14+ }
15+ }
16+
17+ const unityHubPath = getUnityHubPath ( ) ;
918
1019export const getUnityInstallations = async ( ) : Promise < UnityInstallations > => {
1120 const { stdout } = await execa ( unityHubPath , "-- --headless editors -i" . split ( " " ) , { reject : false } ) ;
You can’t perform that action at this time.
0 commit comments