File tree 2 files changed +18
-8
lines changed
2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,13 @@ const VersionCommand = Command.extend({
43
43
ngCliVersion = `local (v${ pkg . version } , branch: ${ gitBranch } )` ;
44
44
}
45
45
const config = CliConfig . fromProject ( ) ;
46
- if ( config && config . config . project . version !== pkg . version ) {
47
- ngCliVersion += ` [${ config . config . project . version } ]` ;
48
- }
49
- if ( config && config . config . project . ejected ) {
50
- ngCliVersion += ' (e)' ;
46
+ if ( config && config . config && config . config . project ) {
47
+ if ( config . config . project . version !== pkg . version ) {
48
+ ngCliVersion += ` [${ config . config . project . version } ]` ;
49
+ }
50
+ if ( config . config . project . ejected ) {
51
+ ngCliVersion += ' (e)' ;
52
+ }
51
53
}
52
54
53
55
if ( projPkg ) {
Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ export class CliConfig extends CliConfigBase<ConfigInterface> {
47
47
}
48
48
49
49
static fromGlobal ( ) : CliConfig {
50
- const globalConfigPath = path . join ( getUserHome ( ) , CLI_CONFIG_FILE_NAME ) ;
50
+ let globalConfigPath = path . join ( getUserHome ( ) , CLI_CONFIG_FILE_NAME ) ;
51
+ const altGlobalConfigPath = path . join ( getUserHome ( ) , CLI_CONFIG_FILE_NAME_ALT ) ;
52
+ if ( ! fs . existsSync ( globalConfigPath ) && fs . existsSync ( altGlobalConfigPath ) ) {
53
+ globalConfigPath = altGlobalConfigPath ;
54
+ }
51
55
52
56
const cliConfig = CliConfigBase . fromConfigPath < ConfigInterface > ( globalConfigPath ) ;
53
57
@@ -81,12 +85,16 @@ export class CliConfig extends CliConfigBase<ConfigInterface> {
81
85
82
86
static fromProject ( ) : CliConfig {
83
87
const configPath = this . configFilePath ( ) ;
84
- const globalConfigPath = path . join ( getUserHome ( ) , CLI_CONFIG_FILE_NAME ) ;
85
-
86
88
if ( ! configPath ) {
87
89
return null ;
88
90
}
89
91
92
+ let globalConfigPath = path . join ( getUserHome ( ) , CLI_CONFIG_FILE_NAME ) ;
93
+ const altGlobalConfigPath = path . join ( getUserHome ( ) , CLI_CONFIG_FILE_NAME_ALT ) ;
94
+ if ( ! fs . existsSync ( globalConfigPath ) && fs . existsSync ( altGlobalConfigPath ) ) {
95
+ globalConfigPath = altGlobalConfigPath ;
96
+ }
97
+
90
98
const cliConfig = CliConfigBase . fromConfigPath < ConfigInterface > (
91
99
CliConfig . configFilePath ( ) , [ globalConfigPath ] ) ;
92
100
You can’t perform that action at this time.
0 commit comments