From e6868ccf907b914b8b57eda6b480bdfc3f53b26a Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Mon, 14 Mar 2016 14:32:23 +0100 Subject: [PATCH] Only show ember-cli-shims errors if actually installed This is useful for blueprint testing scenarios of other Ember.js addons, where ember-cli-shims might be mentioned in bower.json but is not actually installed just for the blueprint testing. --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 40f1e8bb68d..f6a6ca6d979 100644 --- a/index.js +++ b/index.js @@ -52,17 +52,17 @@ module.exports = { var emberDataBower = checker.for('ember-data', 'bower'); - if (shims && !shims.satisfies('< 0.1.0') && emberDataBower.satisfies('< 2.3.0-beta.3')) { + if (shims && shims.version && !shims.satisfies('< 0.1.0') && emberDataBower.satisfies('< 2.3.0-beta.3')) { throw new SilentError('Using a version of ember-cli-shims greater than or equal to 0.1.0 will cause errors while loading Ember Data < 2.3.0-beta.3 Please update ember-cli-shims from ' + shims.version + ' to 0.0.6'); } - if (shims && !shims.satisfies('>= 0.1.0') && emberDataBower.satisfies('>= 2.3.0-beta.3')) { + if (shims && shims.version && !shims.satisfies('>= 0.1.0') && emberDataBower.satisfies('>= 2.3.0-beta.3')) { throw new SilentError('Using a version of ember-cli-shims prior to 0.1.0 will cause errors while loading Ember Data 2.3.0-beta.3+. Please update ember-cli-shims from ' + shims.version + ' to 0.1.0.'); } } else { // NPM only, but ember-cli-shims does not match - if (shims && !shims.satisfies('>= 0.1.0') && semver.satisfies(version, '^2.3.0-beta.3')) { + if (shims && shims.version && !shims.satisfies('>= 0.1.0') && semver.satisfies(version, '^2.3.0-beta.3')) { throw new SilentError('Using a version of ember-cli-shims prior to 0.1.0 will cause errors while loading Ember Data 2.3.0-beta.3+. Please update ember-cli-shims from ' + shims.version + ' to 0.1.0.'); } }