Skip to content

Commit

Permalink
refactor(commands): turn .run commands into tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva committed Jan 27, 2017
1 parent 7edac2b commit 4eef41d
Show file tree
Hide file tree
Showing 14 changed files with 581 additions and 572 deletions.
17 changes: 0 additions & 17 deletions packages/angular-cli/commands/build.run.ts

This file was deleted.

19 changes: 16 additions & 3 deletions packages/angular-cli/commands/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BuildOptions } from '../models/webpack-config';
import { BuildOptions } from '../models/build-options';
import { Version } from '../upgrade/version';

const Command = require('../ember-cli/lib/models/command');

Expand All @@ -22,7 +23,7 @@ export const BaseBuildCommandOptions: any = [
{ name: 'i18n-file', type: String },
{ name: 'i18n-format', type: String },
{ name: 'locale', type: String },
{ name: 'extract-css', type: Boolean, aliases: ['ec']},
{ name: 'extract-css', type: Boolean, aliases: ['ec'] },
{
name: 'output-hashing',
type: String,
Expand All @@ -46,7 +47,19 @@ const BuildCommand = Command.extend({
]),

run: function (commandOptions: BuildTaskOptions) {
return require('./build.run').default.call(this, commandOptions);
const project = this.project;

// Check angular version.
Version.assertAngularVersionIs2_3_1OrHigher(project.root);

const BuildTask = require('../tasks/build').default;

const buildTask = new BuildTask({
cliProject: project,
ui: this.ui,
});

return buildTask.run(commandOptions);
}
});

Expand Down
272 changes: 0 additions & 272 deletions packages/angular-cli/commands/github-pages-deploy.run.ts

This file was deleted.

Loading

0 comments on commit 4eef41d

Please sign in to comment.