Skip to content

Commit 5db0bb5

Browse files
committed
Force module install
1 parent f2250e9 commit 5db0bb5

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

dist/.DS_Store

0 Bytes
Binary file not shown.

dist/index.js

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/model/platform-setup/setup-mac.ts

+22
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class SetupMac {
2020
await SetupMac.installUnity(buildParameters);
2121
}
2222

23+
await SetupMac.ensureRequiredModuleIsInstalled(buildParameters);
24+
2325
await SetupMac.setEnvironmentVariables(buildParameters, actionFolder);
2426
}
2527

@@ -119,6 +121,26 @@ class SetupMac {
119121
return moduleArgument;
120122
}
121123

124+
private static async ensureRequiredModuleIsInstalled(buildParameters: BuildParameters) {
125+
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
126+
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
127+
128+
const execArguments: string[] = [
129+
'--',
130+
'--headless',
131+
'install-modules',
132+
...['--version', buildParameters.editorVersion],
133+
...['--changeset', unityChangeset.changeset],
134+
...moduleArguments,
135+
'--childModules',
136+
];
137+
138+
await exec(this.unityHubExecPath, execArguments, {
139+
silent: true,
140+
ignoreReturnCode: true,
141+
});
142+
}
143+
122144
private static async installUnity(buildParameters: BuildParameters, silent = false) {
123145
const unityEditorPath = `/Applications/Unity/Hub/Editor/${buildParameters.editorVersion}`;
124146
const key = `Cache-MacOS-UnityEditor-With-Module-${buildParameters.targetPlatform}@${buildParameters.editorVersion}`;

0 commit comments

Comments
 (0)