diff --git a/lib/application.js b/lib/application.js index e259d8f..b961f3e 100644 --- a/lib/application.js +++ b/lib/application.js @@ -66,9 +66,10 @@ module.exports = function Application() { function _shutDown() { logger.log('Shutting down private-bower'); - - _listeningServer.close(); - + if(_listeningServer){ + _listeningServer.close(); + } + publicPackageStore.shutDown(); if(_repoCacheHandler) { diff --git a/lib/service/packageDetailsProvider.js b/lib/service/packageDetailsProvider.js index a2cf5f3..18bc497 100644 --- a/lib/service/packageDetailsProvider.js +++ b/lib/service/packageDetailsProvider.js @@ -9,9 +9,8 @@ var SvnPackageDetailsProvider = require('./svnPackageDetailsProvider'); var utils = require('../infrastructure/utils'); module.exports = function PackageDetailsProvider() { - function _getPackageDetails(packageUrl) { - if(packageUrl.substring(0, 4) === 'svn+') { + if(packageUrl.startsWith('svn+')) { return SvnPackageDetailsProvider.getPackageDetails(packageUrl); } return GitPackageDetailsProvider.getPackageDetails(packageUrl);