Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for Ember version with new ember-cli-version-checker API. #166

Merged
merged 2 commits into from
Apr 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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