Skip to content

Commit

Permalink
unity-setup@v1.0.16
Browse files Browse the repository at this point in the history
- fix editor install corrupted async hook edge case
  • Loading branch information
StephenHodgson committed Jan 28, 2025
1 parent 4773acc commit 1fce0ff
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
10 changes: 9 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34805,7 +34805,15 @@ async function Unity(version, changeset, architecture, modules) {
}
let editorPath = await checkInstalledEditors(version, architecture, false);
if (!editorPath) {
await installUnity(version, changeset, architecture, modules);
try {
await installUnity(version, changeset, architecture, modules);
}
catch (error) {
if (error.message.includes('Editor already installed in this location')) {
uninstallUnity(editorPath);
await installUnity(version, changeset, architecture, modules);
}
}
editorPath = await checkInstalledEditors(version, architecture);
}
await fs.promises.access(editorPath, fs.constants.X_OK);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unity-setup",
"version": "1.0.15",
"version": "1.0.16",
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
"author": "Buildalon",
"license": "MIT",
Expand Down
11 changes: 9 additions & 2 deletions src/unity-hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ async function execUnityHub(args: string[]): Promise<string> {
const match = output.match(/Assertion (?<assert>.+) failed/g);
if (match ||
output.includes('async hook stack has become corrupted')) {
core.warning(`Install failed, retrying...`)
core.warning(`Install failed, retrying...`);
return await execUnityHub(args);
}
if (output.includes('Error:')) {
Expand All @@ -234,7 +234,14 @@ async function Unity(version: string, changeset: string, architecture: string, m
}
let editorPath = await checkInstalledEditors(version, architecture, false);
if (!editorPath) {
await installUnity(version, changeset, architecture, modules);
try {
await installUnity(version, changeset, architecture, modules);
} catch (error) {
if (error.message.includes('Editor already installed in this location')) {
uninstallUnity(editorPath);
await installUnity(version, changeset, architecture, modules);
}
}
editorPath = await checkInstalledEditors(version, architecture);
}
await fs.promises.access(editorPath, fs.constants.X_OK);
Expand Down

0 comments on commit 1fce0ff

Please sign in to comment.