Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #102 from Financial-Times/handle-bower-branches
Browse files Browse the repository at this point in the history
allow branches of bower components
  • Loading branch information
wheresrhys committed May 6, 2015
2 parents 7f9c582 + 32bd7a2 commit 4c3896f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/verify-layout-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ module.exports = function(opts) {
}

// test to see if the component is a compatible version
var appSemver = require(path.join(process.cwd(), 'bower_components', dep, '.bower.json')).version;
if (!semver.satisfies(appSemver, layoutBowerDeps[dep])) {
reject('This app needs to install a version of ' + dep + ' compatible with the semver ' + layoutBowerDeps[dep] + ' in order to render layouts');
var bowerJson = require(path.join(process.cwd(), 'bower_components', dep, '.bower.json'));
var appSemver = bowerJson.version;
if (!appSemver) {
if (bowerJson._resolution.type === 'branch') {
console.warn('This app is using a non-versioned release of ' + dep);
console.warn('It\'s ok to do so while experimenting, but longer term try to revert to using a semvered version');
} else {
reject('Unknown bower resolution for ' + dep + '. Use a branch or semver');
}
} else {
if (!semver.satisfies(appSemver, layoutBowerDeps[dep])) {
reject('This app needs to install a version of ' + dep + ' compatible with the semver ' + layoutBowerDeps[dep] + ' in order to render layouts');
}
}
}
});
Expand Down

0 comments on commit 4c3896f

Please sign in to comment.