88 * to be usable outside of VS Code.
99 */
1010
11- 'use strict' ;
12-
1311import * as fs from 'fs-extra-promise' ;
1412import * as path from 'path' ;
1513import * as https from 'https' ;
1614import * as stream from 'stream' ;
1715import * as tmp from 'tmp' ;
1816import { parse } from 'url' ;
1917import { Flavor , getInstallDirectory } from './omnisharp' ;
20- import { Platform } from '../platform' ;
18+ import { PlatformInformation , CoreClrFlavor } from '../platform' ;
2119import { getProxyAgent } from '../proxy' ;
2220import { Logger } from './logger' ;
2321
@@ -28,46 +26,44 @@ const OmniSharpVersion = '1.9-beta18';
2826
2927tmp . setGracefulCleanup ( ) ;
3028
31- function getDownloadFileName ( flavor : Flavor , platform : Platform ) : string {
29+ function getDownloadFileName ( flavor : Flavor , coreClrFlavor : CoreClrFlavor ) : string {
3230 let fileName = `omnisharp-${ OmniSharpVersion } -` ;
3331
3432 if ( flavor === Flavor . CoreCLR ) {
35- switch ( platform ) {
36- case Platform . Windows :
33+ switch ( coreClrFlavor ) {
34+ case CoreClrFlavor . Windows :
3735 fileName += 'win-x64-netcoreapp1.0.zip' ;
3836 break ;
39- case Platform . OSX :
37+ case CoreClrFlavor . OSX :
4038 fileName += 'osx-x64-netcoreapp1.0.tar.gz' ;
4139 break ;
42- case Platform . CentOS :
40+ case CoreClrFlavor . CentOS :
4341 fileName += 'centos-x64-netcoreapp1.0.tar.gz' ;
4442 break ;
45- case Platform . Debian :
43+ case CoreClrFlavor . Debian :
4644 fileName += 'debian-x64-netcoreapp1.0.tar.gz' ;
4745 break ;
48- case Platform . Fedora :
46+ case CoreClrFlavor . Fedora :
4947 fileName += 'fedora-x64-netcoreapp1.0.tar.gz' ;
5048 break ;
51- case Platform . OpenSUSE :
49+ case CoreClrFlavor . OpenSUSE :
5250 fileName += 'opensuse-x64-netcoreapp1.0.tar.gz' ;
5351 break ;
54- case Platform . RHEL :
52+ case CoreClrFlavor . RHEL :
5553 fileName += 'rhel-x64-netcoreapp1.0.tar.gz' ;
5654 break ;
57- case Platform . Ubuntu14 :
55+ case CoreClrFlavor . Ubuntu14 :
5856 fileName += 'ubuntu14-x64-netcoreapp1.0.tar.gz' ;
5957 break ;
60- case Platform . Ubuntu16 :
58+ case CoreClrFlavor . Ubuntu16 :
6159 fileName += 'ubuntu16-x64-netcoreapp1.0.tar.gz' ;
6260 break ;
63-
6461 default :
6562 if ( process . platform === 'linux' ) {
66- throw new Error ( `Unsupported linux distribution` ) ;
67- }
68- else {
69- throw new Error ( `Unsupported platform: ${ process . platform } ` ) ;
63+ throw new Error ( 'Unsupported linux distribution' ) ;
7064 }
65+
66+ throw new Error ( `Unsupported platform: ${ process . platform } ` ) ;
7167 }
7268 }
7369 else if ( flavor === Flavor . Desktop ) {
@@ -109,9 +105,9 @@ function download(urlString: string, proxy?: string, strictSSL?: boolean): Promi
109105 } ) ;
110106}
111107
112- export function go ( flavor : Flavor , platform : Platform , logger : Logger , proxy ?: string , strictSSL ?: boolean ) {
108+ export function go ( flavor : Flavor , coreClrFlavor : CoreClrFlavor , logger : Logger , proxy ?: string , strictSSL ?: boolean ) {
113109 return new Promise < boolean > ( ( resolve , reject ) => {
114- const fileName = getDownloadFileName ( flavor , platform ) ;
110+ const fileName = getDownloadFileName ( flavor , coreClrFlavor ) ;
115111 const installDirectory = getInstallDirectory ( flavor ) ;
116112
117113 logger . appendLine ( `Installing OmniSharp to ${ installDirectory } ` ) ;
0 commit comments