Skip to content

Commit

Permalink
Skipping deprecation warning if ember-cli is below 2.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
Garrett Murphey committed Sep 28, 2016
1 parent da10d3f commit ecfdcff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
/* jshint node: true */
'use strict';

var VersionChecker = require('ember-cli-version-checker');

module.exports = {
name: 'ember-try',
init: function() {
this._super.init && this._super.init.apply(this, arguments);
if (this.project.pkg.devDependencies && this.project.pkg.devDependencies['ember-try']) {

var checker = new VersionChecker(this);
var cliVersion = checker.for('ember-cli', 'npm');

if (cliVersion.satisfies('>= 2.6.0') && this.project.pkg.devDependencies && this.project.pkg.devDependencies['ember-try']) {
this.ui.writeDeprecateLine('ember-try is now included with ember-cli. Including it in your package.json is unnecessary.');
}
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"core-object": "^1.1.0",
"debug": "^2.2.0",
"ember-cli-babel": "^5.1.3",
"ember-cli-version-checker": "^1.1.6",
"ember-try-config": "^2.0.1",
"extend": "^3.0.0",
"fs-extra": "^0.26.0",
Expand Down

0 comments on commit ecfdcff

Please sign in to comment.