44import getos from 'getos' ;
55
66type OS = {
7- release : string ,
87 dist : string ,
8+ release ?: string ,
99} ;
1010
1111const DOWNLOAD_URI = 'https://downloads.mongodb.org' ;
@@ -79,6 +79,8 @@ export default class MongoBinaryDownloadUrl {
7979 return this . getFedoraVersionString ( os ) ;
8080 } else if ( / d e b i a n / i. test ( os . dist ) ) {
8181 return this . getDebianVersionString ( os ) ;
82+ } else if ( / m i n t / i. test ( os . dist ) ) {
83+ return this . getMintVersionString ( os ) ;
8284 }
8385 throw new Error ( `Cannot determine version string for ${ JSON . stringify ( os ) } ` ) ;
8486 }
@@ -109,12 +111,15 @@ export default class MongoBinaryDownloadUrl {
109111
110112 getRhelVersionString ( os : OS ) : string {
111113 let name : string = 'rhel' ;
112- if ( / ^ 7 / . test ( os . release ) ) {
113- name += '70' ;
114- } else if ( / ^ 6 / . test ( os . release ) ) {
115- name += '62' ;
116- } else if ( / ^ 5 / . test ( os . release ) ) {
117- name += '55' ;
114+ const { release } = os ;
115+ if ( release ) {
116+ if ( / ^ 7 / . test ( release ) ) {
117+ name += '70' ;
118+ } else if ( / ^ 6 / . test ( release ) ) {
119+ name += '62' ;
120+ } else if ( / ^ 5 / . test ( release ) ) {
121+ name += '55' ;
122+ }
118123 }
119124 return name ;
120125 }
@@ -124,6 +129,12 @@ export default class MongoBinaryDownloadUrl {
124129 return 'ubuntu1404' ;
125130 }
126131
132+ // eslint-disable-next-line no-unused-vars
133+ getMintVersionString ( os : OS ) : string {
134+ // unfortunately getos doesn't return version for Mint
135+ return 'ubuntu1404' ;
136+ }
137+
127138 getSuseVersionString ( os : any ) : string {
128139 const [ release ] : [ string | null ] = os . release . match ( / ( ^ 1 1 | ^ 1 2 ) / ) || [ null ] ;
129140
0 commit comments