fix version check

This commit is contained in:
Manuel Araoz 2015-03-31 13:11:53 -03:00
parent 996a2f4951
commit a49f0f1c4e
1 changed files with 4 additions and 4 deletions

View File

@ -1,17 +1,17 @@
var bitcore = module.exports;
// module information
bitcore.version = 'v'+require('./package.json').version;
bitcore.version = 'v' + require('./package.json').version;
var inBrowser = typeof process === 'undefined' || typeof process.versions === 'undefined';
if ((inBrowser && window._bitcore) || (!inBrowser && global._bitcore)) {
var versions = bitcore.version + ' and ' + inBrowser ? window._bitcore : global._bitcore;
var versions = bitcore.version + ' and ' + (inBrowser ? window._bitcore : global._bitcore);
var message = 'More than one instance of bitcore found with different versions: ' + versions;
if (inBrowser) {
message += '. Make sure any scripts included don\'t contain their own bitcore bundle.';
} else {
message += '. Make sure there are no version conflicts between package.json files of your '
+ 'dependencies. This could also happen when a package depends on a git repository.';
message += '. Make sure there are no version conflicts between package.json files of your ' +
'dependencies. This could also happen when a package depends on a git repository.';
}
throw new Error(message);