Skip to content

Commit

Permalink
Force module install
Browse files Browse the repository at this point in the history
  • Loading branch information
homapf committed Jul 25, 2024
1 parent f2250e9 commit 5db0bb5
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
Binary file modified dist/.DS_Store
Binary file not shown.
18 changes: 18 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions src/model/platform-setup/setup-mac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class SetupMac {
await SetupMac.installUnity(buildParameters);
}

await SetupMac.ensureRequiredModuleIsInstalled(buildParameters);

await SetupMac.setEnvironmentVariables(buildParameters, actionFolder);
}

Expand Down Expand Up @@ -119,6 +121,26 @@ class SetupMac {
return moduleArgument;
}

private static async ensureRequiredModuleIsInstalled(buildParameters: BuildParameters) {
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);

const execArguments: string[] = [
'--',
'--headless',
'install-modules',
...['--version', buildParameters.editorVersion],
...['--changeset', unityChangeset.changeset],
...moduleArguments,
'--childModules',
];

await exec(this.unityHubExecPath, execArguments, {
silent: true,
ignoreReturnCode: true,
});
}

private static async installUnity(buildParameters: BuildParameters, silent = false) {
const unityEditorPath = `/Applications/Unity/Hub/Editor/${buildParameters.editorVersion}`;
const key = `Cache-MacOS-UnityEditor-With-Module-${buildParameters.targetPlatform}@${buildParameters.editorVersion}`;
Expand Down

0 comments on commit 5db0bb5

Please sign in to comment.