angular-cli/addon/ng2/tasks/link-cli.ts
Ionut Achim 9b8334f79e perf(ng new): command to link to angular-cli (#778)
add `--link-cli` command to link newly generated project to the global `angular-cli`
package. reduces `ng new ...` command time with about 50%
2016-05-19 14:25:29 +01:00

23 lines
611 B
TypeScript

import * as Promise from 'ember-cli/lib/ext/promise';
import * as Task from 'ember-cli/lib/models/task';
import * as chalk from 'chalk';
import {exec} from 'child_process';
module.exports = Task.extend({
run: function() {
var ui = this.ui;
return new Promise(function(resolve, reject) {
exec('npm link angular-cli', (err) => {
if (err) {
ui.writeLine(chalk.red('Couldn\'t do \'npm link angular-cli\'.'));
reject();
} else {
ui.writeLine(chalk.green('Successfully linked to angular-cli.'));
resolve();
}
});
});
}
});