File tree 4 files changed +184
-211
lines changed
4 files changed +184
-211
lines changed Original file line number Diff line number Diff line change 1
1
import * as Command from 'ember-cli/lib/models/command' ;
2
2
import * as path from 'path' ;
3
-
3
+ import * as child_process from 'child_process' ;
4
4
5
5
const VersionCommand = Command . extend ( {
6
6
name : 'version' ,
@@ -21,7 +21,19 @@ const VersionCommand = Command.extend({
21
21
22
22
var alwaysPrint = [ 'node' , 'os' ] ;
23
23
24
- this . printVersion ( 'angular-cli' , pkg . version ) ;
24
+ var ngCliVersion = pkg . version ;
25
+ if ( ! __dirname . match ( / n o d e _ m o d u l e s / ) ) {
26
+ var gitBranch = '??' ;
27
+ try {
28
+ var gitRefName = '' + child_process . execSync ( 'git symbolic-ref HEAD' , { cwd : __dirname } ) ;
29
+ gitBranch = path . basename ( gitRefName . replace ( '\n' , '' ) ) ;
30
+ } catch ( e ) {
31
+ }
32
+
33
+ ngCliVersion = `local (v${ pkg . version } , branch: ${ gitBranch } )` ;
34
+ }
35
+
36
+ this . printVersion ( 'angular-cli' , ngCliVersion ) ;
25
37
26
38
for ( var module in versions ) {
27
39
if ( options . verbose || alwaysPrint . indexOf ( module ) > - 1 ) {
Original file line number Diff line number Diff line change 1
1
var path = require ( 'path' ) ;
2
2
var configReplace = require ( './broccoli-config-replace' ) ;
3
- var compileWithTypescript = require ( './broccoli-typescript' ) . default ;
3
+ var compileWithTypescript = require ( './broccoli-typescript' ) ;
4
4
var SwManifest = require ( './service-worker-manifest' ) . default ;
5
5
var fs = require ( 'fs' ) ;
6
6
var Funnel = require ( 'broccoli-funnel' ) ;
@@ -71,11 +71,6 @@ Angular2App.prototype.toTree = function () {
71
71
exclude : [ '*.d.ts' , 'tsconfig.json' ]
72
72
} ) ;
73
73
74
- var tsSrcTree = new Funnel ( sourceDir , {
75
- include : [ '**/*.ts' ] ,
76
- allowEmpty : true
77
- } ) ;
78
-
79
74
var jsTree = new Funnel ( sourceDir , {
80
75
include : [ '**/*.js' ] ,
81
76
allowEmpty : true
@@ -94,7 +89,6 @@ Angular2App.prototype.toTree = function () {
94
89
95
90
var merged = mergeTrees ( [
96
91
assetTree ,
97
- tsSrcTree ,
98
92
tsTree ,
99
93
jsTree ,
100
94
this . index ( ) ,
You can’t perform that action at this time.
0 commit comments