@@ -5754,7 +5754,7 @@ function expand(str, isTop) {
57545754 var isOptions = m.body.indexOf(',') >= 0;
57555755 if (!isSequence && !isOptions) {
57565756 // {a},b}
5757- if (m.post.match(/,.*\}/)) {
5757+ if (m.post.match(/,(?!,) .*\}/)) {
57585758 str = m.pre + '{' + m.body + escClose + m.post;
57595759 return expand(str);
57605760 }
@@ -34181,7 +34181,20 @@ async function ValidateInputs() {
3418134181 const changesetStr = changeset ? ` (${changeset})` : '';
3418234182 core.info(` > ${version}${changesetStr}`);
3418334183 }
34184- return [versions, architecture, modules, unityProjectPath];
34184+ let installPath = core.getInput('install-path');
34185+ if (installPath) {
34186+ installPath = installPath.trim();
34187+ if (installPath.length === 0) {
34188+ installPath = undefined;
34189+ }
34190+ else {
34191+ core.info(`Install Path:\n > "${installPath}"`);
34192+ }
34193+ }
34194+ if (!installPath) {
34195+ core.debug('No install path specified, using default Unity Hub install path.');
34196+ }
34197+ return [versions, architecture, modules, unityProjectPath, installPath];
3418534198}
3418634199function getArrayInput(key) {
3418734200 let input = core.getInput(key);
@@ -34464,6 +34477,7 @@ async function execSdkManager(sdkManagerPath, javaSdk, args) {
3446434477
3446534478Object.defineProperty(exports, "__esModule", ({ value: true }));
3446634479exports.Get = Get;
34480+ exports.setInstallPath = setInstallPath;
3446734481exports.Unity = Unity;
3446834482exports.ListInstalledEditors = ListInstalledEditors;
3446934483const utility_1 = __nccwpck_require__(5418);
@@ -34704,6 +34718,14 @@ async function execUnityHub(args) {
3470434718 }
3470534719 return output;
3470634720}
34721+ const retryErrorMessages = [
34722+ 'Editor already installed in this location',
34723+ 'failed to download. Error given: Request timeout'
34724+ ];
34725+ async function setInstallPath(installPath) {
34726+ await fs.promises.mkdir(installPath, { recursive: true });
34727+ await execUnityHub(["install-path", "--set", installPath]);
34728+ }
3470734729async function Unity(version, changeset, architecture, modules) {
3470834730 if (os.arch() == 'arm64' && !isArmCompatible(version)) {
3470934731 core.warning(`Unity ${version} does not support arm64 architecture, falling back to x86_64`);
@@ -34724,8 +34746,8 @@ async function Unity(version, changeset, architecture, modules) {
3472434746 await installUnity(version, changeset, architecture, modules);
3472534747 }
3472634748 catch (error) {
34727- if (error.message.includes('Editor already installed in this location' )) {
34728- removePath(editorPath);
34749+ if (retryErrorMessages.some(msg => error.message.includes(msg) )) {
34750+ await removePath(editorPath);
3472934751 await installUnity(version, changeset, architecture, modules);
3473034752 }
3473134753 }
@@ -34749,6 +34771,17 @@ async function Unity(version, changeset, architecture, modules) {
3474934771 core.info(` > ${module}`);
3475034772 }
3475134773 }
34774+ if (process.platform === 'linux') {
34775+ const dataPath = path.join(path.dirname(editorPath), 'Data');
34776+ const beeBackend = path.join(dataPath, 'bee_backend');
34777+ const dotBeeBackend = path.join(dataPath, '.bee_backend');
34778+ if (fs.existsSync(beeBackend) && !fs.existsSync(dotBeeBackend)) {
34779+ await fs.promises.rename(beeBackend, dotBeeBackend);
34780+ const wrapperSource = __nccwpck_require__.ab + "linux-bee-backend-wrapper.sh";
34781+ await fs.promises.copyFile(__nccwpck_require__.ab + "linux-bee-backend-wrapper.sh", beeBackend);
34782+ await fs.promises.chmod(beeBackend, 0o755);
34783+ }
34784+ }
3475234785 }
3475334786 catch (error) {
3475434787 if (error.message.includes(`No modules found`)) {
@@ -45558,12 +45591,15 @@ const unityHub = __nccwpck_require__(2754);
4555845591const core = __nccwpck_require__(2186);
4555945592const main = async () => {
4556045593 try {
45561- const [versions, architecture, modules, unityProjectPath] = await (0, inputs_1.ValidateInputs)();
45594+ const [versions, architecture, modules, unityProjectPath, installPath ] = await (0, inputs_1.ValidateInputs)();
4556245595 if (unityProjectPath) {
4556345596 core.exportVariable('UNITY_PROJECT_PATH', unityProjectPath);
4556445597 }
4556545598 const unityHubPath = await unityHub.Get();
4556645599 core.exportVariable('UNITY_HUB_PATH', unityHubPath);
45600+ if (installPath.length > 0) {
45601+ await unityHub.setInstallPath(installPath);
45602+ }
4556745603 const editors = [];
4556845604 for (const [version, changeset] of versions) {
4556945605 const unityEditorPath = await unityHub.Unity(version, changeset, architecture, modules);
0 commit comments