From e1c47572a6235fd8fd20af888ac3a11c7ae1369d Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:37:40 -0700 Subject: updates --- bin/console.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'bin/console.ts') diff --git a/bin/console.ts b/bin/console.ts index 4b102ee..c92f633 100644 --- a/bin/console.ts +++ b/bin/console.ts @@ -11,14 +11,14 @@ | */ -import 'reflect-metadata' -import { Ignitor, prettyPrintError } from '@adonisjs/core' +import 'reflect-metadata'; +import { Ignitor, prettyPrintError } from '@adonisjs/core'; /** * URL to the application root. AdonisJS need it to resolve * paths to file and directories for scaffolding commands */ -const APP_ROOT = new URL('../', import.meta.url) +const APP_ROOT = new URL('../', import.meta.url); /** * The importer is used to import files in context of the @@ -26,22 +26,22 @@ const APP_ROOT = new URL('../', import.meta.url) */ const IMPORTER = (filePath: string) => { if (filePath.startsWith('./') || filePath.startsWith('../')) { - return import(new URL(filePath, APP_ROOT).href) + return import(new URL(filePath, APP_ROOT).href); } - return import(filePath) -} + return import(filePath); +}; new Ignitor(APP_ROOT, { importer: IMPORTER }) - .tap((app) => { + .tap(app => { app.booting(async () => { - await import('#start/env') - }) - app.listen('SIGTERM', () => app.terminate()) - app.listenIf(app.managedByPm2, 'SIGINT', () => app.terminate()) + await import('#start/env'); + }); + app.listen('SIGTERM', () => app.terminate()); + app.listenIf(app.managedByPm2, 'SIGINT', () => app.terminate()); }) .ace() .handle(process.argv.splice(2)) - .catch((error) => { - process.exitCode = 1 - prettyPrintError(error) - }) + .catch(error => { + process.exitCode = 1; + prettyPrintError(error); + }); -- cgit v1.2.3-70-g09d2