Files
edr-platform/apps/edr-freight-api/src/scripts/main.ts
2026-07-02 13:30:09 +03:00

36 lines
683 B
TypeScript

import "reflect-metadata";
import { config } from "dotenv";
config();
import Vorpal from "vorpal";
import { NestFactory } from "@nestjs/core";
import { AppModule } from "../app.module";
const vorpal = new Vorpal();
async function main() {
const app = await NestFactory.createApplicationContext(AppModule, {
logger: false,
});
try {
// registerCommands(vorpal, { app });
const args = process.argv.slice(2);
if (args.length > 0) {
await vorpal.exec(args.join(" "));
} else {
vorpal.parse(process.argv);
}
} finally {
await app.close();
}
}
main().catch((err) => {
console.error("Script failed:", err);
process.exit(1);
});