Skip to content

Commit

Permalink
fix(core): load default Command from oclif
Browse files Browse the repository at this point in the history
  • Loading branch information
prokopsimek committed Jan 28, 2020
1 parent d0bfc1c commit afc3e4c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
13 changes: 1 addition & 12 deletions bin/run
Original file line number Diff line number Diff line change
@@ -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'));
1 change: 1 addition & 0 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'reflect-metadata';
import { Command, flags } from '@oclif/command';
import { createRootContainer } from '../inversify.config';
import { Scanner } from '../scanner';
Expand Down
1 change: 1 addition & 0 deletions src/commands/practices.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'reflect-metadata';
import { Command, flags } from '@oclif/command';
import { createRootContainer } from '../inversify.config';
import { Scanner } from '../scanner';
Expand Down
1 change: 1 addition & 0 deletions src/commands/run.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export { run } from '@oclif/command';
import 'reflect-metadata';

0 comments on commit afc3e4c

Please sign in to comment.