UNPKG

inngest-setup-redwoodjs

Version:

Setup Inngest in RedwoodJS

30 lines (29 loc) 917 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handler = void 0; const cli_helpers_1 = require("@redwoodjs/cli-helpers"); const tasks_1 = require("./tasks"); function isErrorWithExitCode(e) { return typeof e?.exitCode !== 'undefined'; } const handler = async ({ cwd, force }) => { const tasks = (0, tasks_1.tasks)({ cwd, force }); try { await tasks.run(); } catch (e) { if (e instanceof Error) { // eslint-disable-next-line no-console console.error(cli_helpers_1.colors.error(e.message)); } else { // eslint-disable-next-line no-console console.error(cli_helpers_1.colors.error('Unknown error when running yargs tasks')); } if (isErrorWithExitCode(e)) { process.exit(e.exitCode); } process.exit(1); } }; exports.handler = handler;