Ignore return code

pull/326/head
Andrew Kahr 2022-01-26 15:18:06 -08:00
parent 2bf0a38fb6
commit 62574c7b12
4 changed files with 13 additions and 5 deletions

8
dist/index.js vendored
View File

@ -1220,6 +1220,7 @@ class MacBuilder {
yield exec_1.exec('bash', [`${actionFolder}/platforms/mac/entrypoint.sh`], {
silent,
cwd: `${actionFolder}/platforms/mac`,
ignoreReturnCode: true,
});
});
}
@ -1352,7 +1353,7 @@ class SetupMac {
return __awaiter(this, void 0, void 0, function* () {
const command = 'brew install unity-hub';
if (!fs_1.default.existsSync(this.unityHubPath)) {
yield exec_1.exec(command, undefined, { silent });
yield exec_1.exec(command, undefined, { silent, ignoreReturnCode: true });
}
});
}
@ -1364,7 +1365,10 @@ class SetupMac {
--changeset ${unityChangeset.changeset} \
--module mac-il2cpp \
--childModules`;
yield exec_1.exec(command, undefined, { silent });
const errorCode = yield exec_1.exec(command, undefined, { silent, ignoreReturnCode: true });
if (errorCode) {
throw new Error(`There was an error installing the Unity Editor. See logs above for details.`);
}
});
}
static setEnvironmentVariables(buildParameters) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,7 @@ class MacBuilder {
await exec('bash', [`${actionFolder}/platforms/mac/entrypoint.sh`], {
silent,
cwd: `${actionFolder}/platforms/mac`,
ignoreReturnCode: true,
});
}
}

View File

@ -17,7 +17,7 @@ class SetupMac {
private static async installUnityHub(silent = false) {
const command = 'brew install unity-hub';
if (!fs.existsSync(this.unityHubPath)) {
await exec(command, undefined, { silent });
await exec(command, undefined, { silent, ignoreReturnCode: true });
}
}
@ -28,7 +28,10 @@ class SetupMac {
--changeset ${unityChangeset.changeset} \
--module mac-il2cpp \
--childModules`;
await exec(command, undefined, { silent });
const errorCode = await exec(command, undefined, { silent, ignoreReturnCode: true });
if (errorCode) {
throw new Error(`There was an error installing the Unity Editor. See logs above for details.`);
}
}
private static async setEnvironmentVariables(buildParameters: BuildParameters) {