This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NestFactory } from '@nestjs/core'; | |
| import { OneOffModule } from './one-off.module'; | |
| import * as Executables from './one-offs'; | |
| async function oneOff() { | |
| const klass = process.argv[2]; | |
| const application = await NestFactory.createApplicationContext(OneOffModule); | |
| const oneOff = application.get(Executables[klass]); | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // one-off.module.ts | |
| import { TypeOrmModule } from '@nestjs/typeorm'; | |
| import { Module } from '@nestjs/common'; | |
| import { SendEmailToAdmins } from './one-offs'; | |
| import { EmailModule } from './email/email.module'; | |
| @Module({ | |
| imports: [ | |
| EmailModule, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // one-off.ts | |
| import { NestFactory } from '@nestjs/core'; | |
| import { OneOffModule } from './one-off.module'; | |
| async function oneOff() { | |
| const application = await NestFactory.createApplicationContext(OneOffModule); | |
| await application.close(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Tue Mar 5 15:09:50 UTC 2019 |