Skip to content

Commit 1803d2f

Browse files
committed
Fix imports to config files
1 parent 274bc67 commit 1803d2f

4 files changed

Lines changed: 36 additions & 2 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var ClassicFileInfo = require('./classic-file-info');
2+
3+
var ConfigFileInfo = ClassicFileInfo.extend({
4+
fileInfoType: 'ConfigFileInfo',
5+
6+
7+
init: function(options) {
8+
options.type = 'config';
9+
options.base = '.';
10+
options.sourceRoot = '.';
11+
12+
this._super(options);
13+
},
14+
15+
populateCollection: function() {
16+
this.collection = '..';
17+
this.collectionGroup = '';
18+
}
19+
});
20+
21+
module.exports = ConfigFileInfo;

lib/engines/classic/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var TemplateFileInfo = require('./template-file-info');
88
var ComponentTemplateFileInfo = require('./component-template-file-info');
99
var MainFileInfo = require('./main-file-info');
1010
var MixinFileInfo = require('./mixin-file-info');
11+
var ConfigFileInfo = require('./config-file-info');
1112

1213
module.exports = {
1314
buildFor: function(sourceRelativePath, options) {
@@ -70,6 +71,8 @@ module.exports = {
7071

7172
return new TestFileInfo(options);
7273
}
74+
} else if (sourceRoot === 'config') {
75+
return new ConfigFileInfo(options);
7376
}
7477
}
7578
};

lib/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ var Engine = CoreObject.extend({
3434
},
3535

3636
_queueMoveFile: function(source, dest) {
37+
if (source === dest) {
38+
return;
39+
}
40+
3741
var logger = this._logger;
3842

3943
this._promise = this._promise
@@ -95,7 +99,8 @@ var Engine = CoreObject.extend({
9599
this._promise = RSVP.resolve();
96100
var inputFiles = [].concat(
97101
this._filesInDir('app'),
98-
this._filesInDir('tests')
102+
this._filesInDir('tests'),
103+
this._filesInDir('config')
99104
);
100105

101106
var verbose = this.verbose;

lib/utils/path.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ function makeRelative(from, to) {
1313
}
1414

1515
function makeAbsolute(base, path) {
16-
return p.resolve(p.dirname('/' + base), path).substring(1);
16+
var isConfigPath = path.indexOf('/config/') > 0;
17+
var baseDir = p.dirname('/' + base);
18+
if (isConfigPath) {
19+
baseDir += '/..';
20+
}
21+
return p.resolve(baseDir, path).substring(1);
1722
}
1823

1924
module.exports = {

0 commit comments

Comments
 (0)