Skip to content

Commit 41da337

Browse files
clydinfilipesilva
authored andcommitted
refactor(@angular/cli): remove intermediate init command
1 parent b7e39b1 commit 41da337

File tree

2 files changed

+6
-56
lines changed

2 files changed

+6
-56
lines changed

packages/@angular/cli/commands/init.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

packages/@angular/cli/commands/new.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ import * as fs from 'fs';
22
import * as path from 'path';
33
import * as chalk from 'chalk';
44

5-
import InitCommand from './init';
65
import { CliConfig } from '../models/config';
76
import { validateProjectName } from '../utilities/validate-project-name';
87
import { oneLine } from 'common-tags';
98
import { SchematicAvailableOptions } from '../tasks/schematic-get-options';
109

1110
const Command = require('../ember-cli/lib/models/command');
12-
const Project = require('../ember-cli/lib/models/project');
1311
const SilentError = require('silent-error');
1412

1513
const NewCommand = Command.extend({
@@ -150,15 +148,15 @@ const NewCommand = Command.extend({
150148
commandOptions.collectionName = this.getCollectionName(rawArgs);
151149
}
152150

153-
const initCommand = new InitCommand({
154-
ui: this.ui,
151+
const InitTask = require('../tasks/init').default;
152+
153+
const initTask = new InitTask({
154+
project: this.project,
155155
tasks: this.tasks,
156-
project: Project.nullProject(this.ui, this.cli)
156+
ui: this.ui,
157157
});
158158

159-
return Promise.resolve()
160-
.then(initCommand.run.bind(initCommand, commandOptions, rawArgs));
161-
159+
return initTask.run(commandOptions, rawArgs);
162160
}
163161
});
164162

0 commit comments

Comments
 (0)