forked from adopted-ember-addons/emberx-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (23 loc) · 880 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* jshint node: true */
'use strict';
module.exports = {
name: 'emberx-select',
hasContextualComponents: function () {
var VersionChecker = require('ember-cli-version-checker');
var checker = new VersionChecker(this);
var dep = checker.for('ember', 'bower');
var isBetaOrCanary = ['beta', 'canary'].filter(function(version) {
return dep.version.indexOf(version) >= 0;
});
return !!(dep.satisfies('>= 2.3.0 < 3.0.0') || isBetaOrCanary.length > 0);
},
treeForAddonTemplates: function treeForAddonTemplates(tree) {
var path = require('path');
var baseTemplatesPath = path.join(this.root, 'addon/templates');
if (this.hasContextualComponents()) {
return this.treeGenerator(path.join(baseTemplatesPath, 'current'));
} else {
return this.treeGenerator(path.join(baseTemplatesPath, 'less-than-2.3'));
}
}
};