pull/496/head
Frostebite 2023-03-07 17:36:56 +00:00
parent d79ac1330f
commit ce31daa2dc
5 changed files with 18 additions and 8 deletions

13
dist/index.js vendored
View File

@ -2997,7 +2997,7 @@ cp -a ${sharedFolder}. /github/workspace/cloud-runner-cache/
myOutput += `[LOCAL-DOCKER-ERROR]${data.toString()}`; myOutput += `[LOCAL-DOCKER-ERROR]${data.toString()}`;
}, },
}, },
}, true); }, true, false);
return myOutput; return myOutput;
} }
} }
@ -5886,7 +5886,7 @@ const node_path_1 = __importDefault(__nccwpck_require__(49411));
class Docker { class Docker {
static async run(image, parameters, silent = false, overrideCommands = '', additionalVariables = [], static async run(image, parameters, silent = false, overrideCommands = '', additionalVariables = [],
// eslint-disable-next-line unicorn/no-useless-undefined // eslint-disable-next-line unicorn/no-useless-undefined
options = undefined, entrypointBash = false) { options = undefined, entrypointBash = false, errorWhenMissingUnityBuildResults = true) {
let runCommand = ''; let runCommand = '';
switch (process.platform) { switch (process.platform) {
case 'linux': case 'linux':
@ -5897,10 +5897,10 @@ class Docker {
} }
if (options) { if (options) {
options.silent = silent; options.silent = silent;
await exec_with_error_check_1.execWithErrorCheck(runCommand, undefined, options); await exec_with_error_check_1.execWithErrorCheck(runCommand, undefined, options, errorWhenMissingUnityBuildResults);
} }
else { else {
await exec_with_error_check_1.execWithErrorCheck(runCommand, undefined, { silent }); await exec_with_error_check_1.execWithErrorCheck(runCommand, undefined, { silent }, errorWhenMissingUnityBuildResults);
} }
} }
static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) { static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) {
@ -6002,8 +6002,11 @@ exports["default"] = ValidationError;
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.execWithErrorCheck = void 0; exports.execWithErrorCheck = void 0;
const exec_1 = __nccwpck_require__(71514); const exec_1 = __nccwpck_require__(71514);
async function execWithErrorCheck(commandLine, arguments_, options) { async function execWithErrorCheck(commandLine, arguments_, options, errorWhenMissingUnityBuildResults = true) {
const result = await exec_1.getExecOutput(commandLine, arguments_, options); const result = await exec_1.getExecOutput(commandLine, arguments_, options);
if (!errorWhenMissingUnityBuildResults) {
return result.exitCode;
}
// Check for errors in the Build Results section // Check for errors in the Build Results section
const match = result.stdout.match(/^#\s*Build results\s*#(.*)^Size:/ms); const match = result.stdout.match(/^#\s*Build results\s*#(.*)^Size:/ms);
if (match) { if (match) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -149,6 +149,7 @@ cp -a ${sharedFolder}. /github/workspace/cloud-runner-cache/
}, },
}, },
true, true,
false,
); );
return myOutput; return myOutput;

View File

@ -15,6 +15,7 @@ class Docker {
// eslint-disable-next-line unicorn/no-useless-undefined // eslint-disable-next-line unicorn/no-useless-undefined
options: ExecOptions | undefined = undefined, options: ExecOptions | undefined = undefined,
entrypointBash: boolean = false, entrypointBash: boolean = false,
errorWhenMissingUnityBuildResults: boolean = true,
) { ) {
let runCommand = ''; let runCommand = '';
switch (process.platform) { switch (process.platform) {
@ -26,9 +27,9 @@ class Docker {
} }
if (options) { if (options) {
options.silent = silent; options.silent = silent;
await execWithErrorCheck(runCommand, undefined, options); await execWithErrorCheck(runCommand, undefined, options, errorWhenMissingUnityBuildResults);
} else { } else {
await execWithErrorCheck(runCommand, undefined, { silent }); await execWithErrorCheck(runCommand, undefined, { silent }, errorWhenMissingUnityBuildResults);
} }
} }

View File

@ -4,9 +4,14 @@ export async function execWithErrorCheck(
commandLine: string, commandLine: string,
arguments_?: string[], arguments_?: string[],
options?: ExecOptions, options?: ExecOptions,
errorWhenMissingUnityBuildResults: boolean = true,
): Promise<number> { ): Promise<number> {
const result = await getExecOutput(commandLine, arguments_, options); const result = await getExecOutput(commandLine, arguments_, options);
if (!errorWhenMissingUnityBuildResults) {
return result.exitCode;
}
// Check for errors in the Build Results section // Check for errors in the Build Results section
const match = result.stdout.match(/^#\s*Build results\s*#(.*)^Size:/ms); const match = result.stdout.match(/^#\s*Build results\s*#(.*)^Size:/ms);