Merge branch 'release/2.6.1' into production

This commit is contained in:
Miroslav Bajtoš 2015-01-12 18:00:59 +01:00
commit ab33132ef7
3 changed files with 18 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2015-01-12, Version 2.6.1
=========================
* Fix "incompatible loopback version" check & msg (Miroslav Bajtoš)
2015-01-08, Version 2.6.0 2015-01-08, Version 2.6.0
========================= =========================

View File

@ -4,6 +4,7 @@ var semver = require('semver');
var debug = require('debug')('loopback:boot:executor'); var debug = require('debug')('loopback:boot:executor');
var async = require('async'); var async = require('async');
var path = require('path'); var path = require('path');
var format = require('util').format;
/** /**
* Execute bootstrap instructions gathered by `boot.compile`. * Execute bootstrap instructions gathered by `boot.compile`.
@ -73,12 +74,17 @@ function assertLoopBackVersion(app) {
var RANGE = '1.x || 2.x'; var RANGE = '1.x || 2.x';
var loopback = app.loopback; var loopback = app.loopback;
if (!semver.satisfies(loopback.version || '1.0.0', RANGE)) { // remove any pre-release tag from the version string,
throw new Error( // because semver has special treatment of pre-release versions,
'The `app` is powered by an incompatible loopback version %s. ' + // while loopback-boot treats pre-releases the same way as regular versions
'Supported versions: %s', var version = (loopback.version || '1.0.0').replace(/-.*$/, '');
loopback.version || '(unknown)', if (!semver.satisfies(version, RANGE)) {
var msg = format(
'The `app` is powered by an incompatible loopback version %s. ' +
'Supported versions: %s',
loopback.version || '(unknown)',
RANGE); RANGE);
throw new Error(msg);
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "loopback-boot", "name": "loopback-boot",
"version": "2.6.0", "version": "2.6.1",
"description": "Convention-based bootstrapper for LoopBack applications", "description": "Convention-based bootstrapper for LoopBack applications",
"keywords": [ "keywords": [
"StrongLoop", "StrongLoop",