Fix not handling correctly exit cause

This commit is contained in:
Joseph Garrone 2024-10-06 06:41:51 +02:00
parent 8fc307bd8d
commit c4ee6cd85c
2 changed files with 3 additions and 11 deletions

View File

@ -168,12 +168,8 @@ program
handler: async ({ projectDirPath }) => {
const buildContext = getBuildContext({ projectDirPath });
console.log("before callHandlerIfAny");
callHandlerIfAny({ buildContext, commandName });
console.log("after callHandlerIfAny");
const { command } = await import("./eject-page");
await command({ buildContext });

View File

@ -8,7 +8,6 @@ import {
ApiVersion
} from "./customHandler";
import * as child_process from "child_process";
import { is } from "tsafe/is";
import { dirname as pathDirname } from "path";
import * as fs from "fs";
@ -34,16 +33,13 @@ export function callHandlerIfAny(params: {
}
});
} catch (error: any) {
console.log(error.message);
console.log(error.status);
const status = error.status;
assert(is<child_process.ExecException>(error));
if (error.code === NOT_IMPLEMENTED_EXIT_CODE) {
if (status === NOT_IMPLEMENTED_EXIT_CODE) {
return;
}
process.exit(error.code);
process.exit(status);
}
process.exit(0);