-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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%
- Loading branch information
1 parent
482aa74
commit 9b8334f
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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(); | ||
} | ||
}); | ||
}); | ||
} | ||
}); |