diff --git a/bin/run b/bin/run index 4c7b03a36..8a4f01f25 100755 --- a/bin/run +++ b/bin/run @@ -1,17 +1,6 @@ #!/usr/bin/env node /* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */ -const fs = require('fs'); -const path = require('path'); -const project = path.join(__dirname, '../tsconfig.json'); -const dev = fs.existsSync(project); - -if (dev) { - require('ts-node').register({ project }); - console.warn("WARNING: You're running DX Scanner in development mode.") -} - -require(`../${dev ? 'src' : 'lib'}`) - .run() +require('@oclif/command').run() .then(require('@oclif/command/flush')) .catch(require('@oclif/errors/handle')); diff --git a/src/commands/init.ts b/src/commands/init.ts index 23471a08f..fc105d868 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -1,3 +1,4 @@ +import 'reflect-metadata'; import { Command, flags } from '@oclif/command'; import { createRootContainer } from '../inversify.config'; import { Scanner } from '../scanner'; diff --git a/src/commands/practices.ts b/src/commands/practices.ts index 6c57bd4f3..b26ee48a6 100644 --- a/src/commands/practices.ts +++ b/src/commands/practices.ts @@ -1,3 +1,4 @@ +import 'reflect-metadata'; import { Command, flags } from '@oclif/command'; import { createRootContainer } from '../inversify.config'; import { Scanner } from '../scanner'; diff --git a/src/commands/run.ts b/src/commands/run.ts index 91c42a649..bb65b2284 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -1,4 +1,5 @@ /* eslint-disable no-process-env */ +import 'reflect-metadata'; import { Command, flags } from '@oclif/command'; import cli from 'cli-ux'; import debug from 'debug'; diff --git a/src/index.ts b/src/index.ts index daee635c5..63a56fdff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1 @@ export { run } from '@oclif/command'; -import 'reflect-metadata';