File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,13 @@ const getUnityHubPath = () => {
1414 }
1515}
1616
17+ const parseUnityPath = ( basePath : string ) => {
18+ switch ( process . platform ) {
19+ case "win32" : return basePath ;
20+ default : return path . join ( basePath , "/Contents/MacOS/Unity" ) ;
21+ }
22+ }
23+
1724const unityHubPath = getUnityHubPath ( ) ;
1825
1926export const getUnityInstallations = async ( ) : Promise < UnityInstallations > => {
@@ -26,11 +33,11 @@ export const getUnityInstallations = async (): Promise<UnityInstallations> => {
2633 const installations : UnityInstallations = { } ;
2734
2835 lines . forEach ( line => {
29- const [ version , path ] = line
36+ const [ version , unityPath ] = line
3037 . split ( ", installed at" )
3138 . map ( entry => entry . trim ( ) ) ;
3239
33- if ( ! ! version || ! ! path ) installations [ version ] = path ;
40+ if ( ! ! version || ! ! path ) installations [ version ] = parseUnityPath ( unityPath ) ;
3441 } ) ;
3542
3643 if ( Object . keys ( installations ) . length == 0 ) throw `No unity installations found at ${ unityHubPath } .` ;
You can’t perform that action at this time.
0 commit comments