Skip to content

Commit 6c2a675

Browse files
authored
Merge pull request #55 from atsao/override-config-dir
Allow custom addon config directory
2 parents 7d01154 + d267505 commit 6c2a675

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,20 @@ module.exports = function(env) {
8888
}
8989
```
9090

91+
### Configuration
92+
93+
In some cases, it may be necessary to indicate a different `config` directory from the default one (`/config`). For example, you may want the flushed deprecations file to be referenced in a config directory like `my-config`.
94+
95+
Adjust the `configPath` in your `package.json` file. The `/` will automatically be prefixed.
96+
97+
```javascript
98+
{
99+
'ember-addon': {
100+
configPath: 'my-config'
101+
}
102+
}
103+
```
104+
91105
## Contributing
92106

93107
Details on contributing to the addon itself (not required for normal usage).

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ module.exports = {
3333

3434
treeForVendor: function(tree) {
3535
var root = process.env._DUMMY_CONFIG_ROOT_PATH || this.project.root;
36+
var configDir = '/config';
37+
38+
if (this.project.pkg['ember-addon'] && this.project.pkg['ember-addon']['configPath']) {
39+
configDir = '/' + this.project.pkg['ember-addon']['configPath'];
40+
}
41+
3642
var mergeTrees = require('broccoli-merge-trees');
3743
var Funnel = require('broccoli-funnel');
38-
var configTree = new Funnel(root + '/config', {
44+
var configTree = new Funnel(root + configDir, {
3945
include: ['deprecation-workflow.js'],
4046

4147
destDir: 'ember-cli-deprecation-workflow'

0 commit comments

Comments
 (0)