Skip to content

Commit

Permalink
Check for Ember version with new ember-cli-version-checker API. (#166)
Browse files Browse the repository at this point in the history
Check for Ember version with new ember-cli-version-checker API.
  • Loading branch information
dan-ste authored and andrewhavens committed Apr 4, 2017
1 parent d12fa08 commit 17f569f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@ module.exports = {
init: function() {
this._super.init && this._super.init.apply(this, arguments);
var checker = new VersionChecker(this);
if (!checker.for('ember-cli', 'npm').isAbove('0.2.6')) {

if (!checker.forEmber().isAbove('0.2.6')) {
console.warn("Warning: ember-modal-dialog requires ember-cli >= 0.2.6 "
+ "for support for the addon-templates tree, which allows "
+ "us to support various ember versions. Use an older "
+ "version of ember-modal-dialog if you are stuck on an "
+ "older ember-cli.");
+ "for support for the addon-templates tree, which allows "
+ "us to support various ember versions. Use an older "
+ "version of ember-modal-dialog if you are stuck on an "
+ "older ember-cli.");
}
},

treeForAddonTemplates: function treeForAddonTemplates (tree) {
var checker = new VersionChecker(this);
var dep = checker.for('ember', 'bower');
var emberVersion = checker.forEmber();

var baseTemplatesPath = path.join(this.root, 'addon/templates');

if (dep.lt('1.13.0-beta.1')) {
if (emberVersion.lt('1.13.0-beta.1')) {
return this.treeGenerator(path.join(baseTemplatesPath, 'lt-1-13'));
} else {
return this.treeGenerator(path.join(baseTemplatesPath, 'current'));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"dependencies": {
"ember-cli-babel": "^5.1.6",
"ember-cli-htmlbars": "^1.0.8",
"ember-cli-version-checker": "^1.1.6",
"ember-cli-version-checker": "^1.2.0",
"ember-wormhole": "~0.3.6"
},
"keywords": [
Expand Down

0 comments on commit 17f569f

Please sign in to comment.