mongodb-download
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -62,2 +62,6 @@ "use strict"; | ||
_this.getMD5Hash().then(function (hash) { | ||
if (!hash) { | ||
console.error("hash is not returned @ getExtractLocation()"); | ||
return reject(); | ||
} | ||
var downloadDir = _this.getDownloadDir(); | ||
@@ -67,2 +71,5 @@ var extractLocation = path.resolve(downloadDir, hash); | ||
resolve(extractLocation); | ||
}, function (e) { | ||
console.error('hash is not returned @ getExtractLocation()', e); | ||
reject(); | ||
}); | ||
@@ -392,3 +399,3 @@ }); | ||
_this.mongoDBPlatform.getOSVersionString().then(function (osString) { | ||
name += "-" + osString; | ||
osString && (name += "-" + osString); | ||
}, function (error) { | ||
@@ -518,10 +525,10 @@ // nothing to add to name ... yet | ||
MongoDBPlatform.prototype.getSuseVersionString = function (os) { | ||
var name = "suse"; | ||
if (/^11/.test(os.release)) { | ||
name += "11"; | ||
var release = (os.release.match(/(^11|^12)/) || [null])[0]; | ||
if (release) { | ||
return "suse" + release; | ||
} | ||
else { | ||
this.debug("using legacy release"); | ||
return ''; | ||
} | ||
return name; | ||
}; | ||
@@ -528,0 +535,0 @@ MongoDBPlatform.prototype.getUbuntuVersionString = function (os) { |
{ | ||
"name": "mongodb-download", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "download mongodb prebuilt packages from mongodb", | ||
@@ -5,0 +5,0 @@ "main": "built/mongodb-download.js", |
@@ -93,2 +93,6 @@ const os: any = require('os'); | ||
this.getMD5Hash().then((hash: string) => { | ||
if (! hash) { | ||
console.error("hash is not returned @ getExtractLocation()"); | ||
return reject(); | ||
} | ||
let downloadDir: string = this.getDownloadDir(); | ||
@@ -98,2 +102,5 @@ let extractLocation: string = path.resolve(downloadDir, hash); | ||
resolve(extractLocation); | ||
}, (e) => { | ||
console.error('hash is not returned @ getExtractLocation()', e); | ||
reject(); | ||
}); | ||
@@ -429,4 +436,4 @@ }); | ||
this.mongoDBPlatform.getOSVersionString().then((osString) => { | ||
name += `-${osString}`; | ||
this.mongoDBPlatform.getOSVersionString().then(osString => { | ||
osString && (name += `-${osString}`); | ||
}, (error) => { | ||
@@ -556,9 +563,10 @@ // nothing to add to name ... yet | ||
getSuseVersionString(os: any): string { | ||
let name: string = "suse"; | ||
if (/^11/.test(os.release)) { | ||
name += "11"; | ||
let [release]: [string | null] = os.release.match(/(^11|^12)/) || [null]; | ||
if (release) { | ||
return `suse${release}`; | ||
} else { | ||
this.debug("using legacy release"); | ||
return ''; | ||
} | ||
return name; | ||
} | ||
@@ -568,3 +576,3 @@ | ||
let name: string = "ubuntu"; | ||
let ubuntu_version: string[] = os.release.split('.'); | ||
let ubuntu_version: string[] = os.release ? os.release.split('.') : ''; | ||
let major_version: number = parseInt(ubuntu_version[0]); | ||
@@ -632,2 +640,2 @@ let minor_version: string = ubuntu_version[1]; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
75299
1400