Skip to content

Commit 5d34c25

Browse files
committed
bug: expose configuration for applying to project model
1 parent 1e9be42 commit 5d34c25

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

addon/ng2/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
name: 'ng2',
88

99
config: function () {
10-
this.project.config = this.project.config || config.CliConfig.fromProject();
10+
this.project.ngConfig = this.project.ngConfig || config.CliConfig.fromProject();
1111
},
1212

1313
includedCommands: function () {

addon/ng2/models/config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export class CliConfig {
3535
throw new Error(`Config file does not exits.`);
3636
}
3737
} else {
38-
this._config = this._fromProject();
38+
this._config = CliConfig.fromProject();
3939
}
4040
}
4141

42-
save(path: string = this._configFilePath()) {
42+
save(path: string = CliConfig._configFilePath()) {
4343
if (!path) {
4444
throw new Error('Could not find config path.');
4545
}
@@ -157,16 +157,16 @@ export class CliConfig {
157157
return { parent, name };
158158
}
159159

160-
private _configFilePath(projectPath?: string): string {
160+
private static _configFilePath(projectPath?: string): string {
161161
// Find the configuration, either where specified, in the angular-cli project
162162
// (if it's in node_modules) or from the current process.
163163
return (projectPath && _findUp(CLI_CONFIG_FILE_NAME, projectPath))
164164
|| _findUp(CLI_CONFIG_FILE_NAME, __dirname)
165165
|| _findUp(CLI_CONFIG_FILE_NAME, process.cwd());
166166
}
167167

168-
private _fromProject(): any {
169-
const configPath = this._configFilePath();
168+
public static fromProject(): any {
169+
const configPath = CliConfig._configFilePath();
170170
return configPath ? require(configPath) : {};
171171
}
172172
}

0 commit comments

Comments
 (0)