@@ -39,33 +39,53 @@ export default class MongoBinaryDownloadUrl {
39
39
}
40
40
41
41
async getArchiveName ( ) : Promise < string > {
42
+ switch ( this . platform ) {
43
+ case 'osx' :
44
+ return this . getArchiveNameOsx ( ) ;
45
+ case 'win32' :
46
+ return this . getArchiveNameWin ( ) ;
47
+ case 'linux' :
48
+ default :
49
+ return this . getArchiveNameLinux ( ) ;
50
+ }
51
+ }
52
+
53
+ async getArchiveNameWin ( ) : Promise < string > {
42
54
let name = `mongodb-${ this . platform } ` ;
55
+ name += `-${ this . arch } ` ;
56
+ name += '-2008plus-ssl' ;
57
+ name += `-${ this . version } .zip` ;
58
+ return name ;
59
+ }
43
60
61
+ async getArchiveNameOsx ( ) : Promise < string > {
62
+ let name = `mongodb-osx` ;
44
63
if ( this . ssl ) {
45
64
name += '-ssl' ;
46
65
}
66
+ name += `-${ this . arch } ` ;
67
+ name += `-${ this . version } .tgz` ;
68
+ return name ;
69
+ }
47
70
71
+ async getArchiveNameLinux ( ) : Promise < string > {
72
+ let name = `mongodb-linux` ;
48
73
name += `-${ this . arch } ` ;
49
74
50
75
let osString ;
51
- if ( this . platform === 'linux' && this . arch !== 'i686' ) {
76
+ if ( this . arch !== 'i686' ) {
52
77
if ( ! this . os ) this . os = await this . getos ( ) ;
53
78
osString = this . getLinuxOSVersionString ( this . os ) ;
54
79
}
55
-
56
80
if ( osString ) {
57
81
name += `-${ osString } ` ;
58
82
}
59
83
60
- name += `-${ this . version } .${ this . getArchiveType ( ) } ` ;
84
+ name += `-${ this . version } .tgz ` ;
61
85
62
86
return name ;
63
87
}
64
88
65
- getArchiveType ( ) : string {
66
- return this . platform === 'win32' ? 'zip' : 'tgz' ;
67
- }
68
-
69
89
async getos ( ) : Promise < OS > {
70
90
return new Promise ( ( resolve , reject ) => {
71
91
getos ( ( e : any , os : any ) => {
0 commit comments