UNPKG

679 BJavaScriptView Raw
1'use strict';
2
3const Reporter = require('./lib/reporter');
4const DependencyChecker = require('./lib/dependency-checker');
5
6module.exports = {
7 name: 'ember-cli-dependency-checker',
8 init: function() {
9 this._super.init && this._super.init.apply(this, arguments);
10
11 // When running `ember <command>`, find the `<command>`
12 const emberPosition = process.argv.findIndex(arg => arg.endsWith('/ember'));
13 const ranWithInit = process.argv[emberPosition + 1] === 'init';
14
15 if (!ranWithInit) {
16 const reporter = new Reporter();
17 const dependencyChecker = new DependencyChecker(this.project, reporter);
18 dependencyChecker.checkDependencies();
19 }
20 }
21};