diff --git a/package.json b/package.json index 84e977abf..33bf78773 100644 --- a/package.json +++ b/package.json @@ -119,10 +119,7 @@ }, "devPlugins": [ "@oclif/plugin-help" - ], - "hooks": { - "init": "./lib/lib/hooks/init" - } + ] }, "nyc": { "branches": "80", diff --git a/src/lib/ScannerCommand.ts b/src/lib/ScannerCommand.ts index 73008d17f..8acd2577a 100644 --- a/src/lib/ScannerCommand.ts +++ b/src/lib/ScannerCommand.ts @@ -2,6 +2,7 @@ import {SfdxCommand} from '@salesforce/command'; import {CategoryFilter, LanguageFilter, RuleFilter, RulesetFilter, RulenameFilter, EngineFilter} from './RuleFilter'; import {uxEvents, EVENTS} from './ScannerEvents'; import {stringArrayTypeGuard} from './util/Utils'; +import {initContainer} from '../ioc.config'; import {AnyJson} from '@salesforce/ts-types'; import {Messages} from '@salesforce/core'; @@ -29,6 +30,8 @@ export abstract class ScannerCommand extends SfdxCommand { */ protected runCommonSteps(): void { this.ux.warn(commonMessages.getMessage('surveyRequestMessage')); + // Bootstrap the IOC container. + initContainer(); } protected buildRuleFilters(): RuleFilter[] { diff --git a/src/lib/hooks/init.ts b/src/lib/hooks/init.ts deleted file mode 100644 index 39f14812e..000000000 --- a/src/lib/hooks/init.ts +++ /dev/null @@ -1,10 +0,0 @@ -import {initContainer} from '../../ioc.config'; - -// runs when the CLI is initialized before a command is found to run -// See https://oclif.io/docs/hooks -const hook = function (): void { - // Bootstrap the ioc container - initContainer(); -} - -export default hook;