MM-54325 Have web app build script return error codes on failure (#24723)

* MM-54325 Have web app build script return error codes on failure

* Make web app --runner option not return an error code
Этот коммит содержится в:
Harrison Healey
2023-10-10 11:17:24 -04:00
коммит произвёл GitHub
родитель bb4aa764bc
Коммит 421fe4b5f0
4 изменённых файлов: 50 добавлений и 14 удалений

Просмотреть файл

@@ -42,6 +42,21 @@ function getColorForWorkspace(workspace) {
return index === -1 ? chalk.white : workspaceColors[index % workspaceColors.length];
}
/**
* @param {import("concurrently").CloseEvent[]} closeEvents - An array of CloseEvents thrown by concurrently when waiting on a result
* @param {number} codeOnSignal - Which error code to return when the process is interrupted
*/
function getExitCode(closeEvents, codeOnSignal = 1) {
const exitCode = closeEvents.find((event) => !event.killed && event.exitCode > 0)?.exitCode;
if (typeof exitCode === 'string') {
return codeOnSignal
} else {
return exitCode;
}
}
module.exports = {
getExitCode,
getPlatformCommands,
};