Fix not handling correctly exit cause

This commit is contained in:
Joseph Garrone 2024-10-06 06:41:51 +02:00
parent 0fe49e3d6e
commit 77f12a940d
2 changed files with 3 additions and 11 deletions

View File

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

View File

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