mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 18:43:42 +08:00
add `--link-cli` command to link newly generated project to the global `angular-cli` package. reduces `ng new ...` command time with about 50%
23 lines
611 B
TypeScript
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();
|
|
}
|
|
});
|
|
});
|
|
}
|
|
});
|