|
8 | 8 | import * as fs from 'fs-extra-promise'; |
9 | 9 | import * as path from 'path'; |
10 | 10 | import * as tmp from 'tmp'; |
| 11 | +import {SupportedPlatform, getSupportedPlatform} from './utils'; |
11 | 12 |
|
12 | 13 | const Decompress = require('decompress'); |
13 | 14 | const Github = require('github-releases'); |
14 | 15 |
|
15 | 16 | const OmnisharpRepo = 'OmniSharp/omnisharp-roslyn'; |
16 | | -const OmnisharpVersion = 'v1.9-alpha10'; |
| 17 | +const OmnisharpVersion = 'v1.9-alpha13'; |
17 | 18 | const DefaultInstallLocation = path.join(__dirname, '../.omnisharp'); |
18 | 19 |
|
19 | 20 | tmp.setGracefulCleanup(); |
20 | 21 |
|
21 | 22 | function getOmnisharpAssetName(): string { |
22 | | - switch (process.platform) { |
23 | | - case 'win32': |
| 23 | + switch (getSupportedPlatform()) { |
| 24 | + case SupportedPlatform.Windows: |
24 | 25 | return 'omnisharp-win-x64-net451.zip'; |
25 | | - case 'darwin': |
| 26 | + case SupportedPlatform.OSX: |
26 | 27 | return 'omnisharp-osx-x64-netcoreapp1.0.tar.gz'; |
27 | | - case 'linux': |
28 | | - return 'omnisharp-linux-x64-netcoreapp1.0.tar.gz'; |
| 28 | + case SupportedPlatform.CentOS: |
| 29 | + return 'omnisharp-centos-x64-netcoreapp1.0.tar.gz'; |
| 30 | + case SupportedPlatform.Debian: |
| 31 | + return 'omnisharp-debian-x64-netcoreapp1.0.tar.gz'; |
| 32 | + case SupportedPlatform.RHEL: |
| 33 | + return 'omnisharp-rhel-x64-netcoreapp1.0.tar.gz'; |
| 34 | + case SupportedPlatform.Ubuntu: |
| 35 | + return 'omnisharp-ubuntu-x64-netcoreapp1.0.tar.gz'; |
| 36 | + |
29 | 37 | default: |
30 | | - throw new Error(`Unsupported platform: ${process.platform}`); |
| 38 | + if (process.platform === 'linux') { |
| 39 | + throw new Error(`Unsupported linux distribution`); |
| 40 | + } |
| 41 | + else { |
| 42 | + throw new Error(`Unsupported platform: ${process.platform}`); |
| 43 | + } |
31 | 44 | } |
32 | 45 | } |
33 | 46 |
|
|
0 commit comments