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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bb4aa764bc
Коммит
421fe4b5f0
@@ -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,
|
||||
};
|
||||
|
||||
Ссылка в новой задаче
Block a user