-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from DustinCampbell/update-omnisharp
Update with latest OmniSharp and pick correct version for current Linux distribution
- Loading branch information
Showing
5 changed files
with
91 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
'use strict'; | ||
|
||
import * as child_process from 'child_process' | ||
|
||
export enum SupportedPlatform { | ||
None, | ||
Windows, | ||
OSX, | ||
CentOS, | ||
Debian, | ||
RHEL, | ||
Ubuntu | ||
} | ||
|
||
export function getSupportedPlatform() { | ||
if (process.platform === 'win32') { | ||
return SupportedPlatform.Windows; | ||
} | ||
else if (process.platform === 'darwin') { | ||
return SupportedPlatform.OSX; | ||
} | ||
else if (process.platform === 'linux') { | ||
// Get the text of /etc/*-release to discover which Linux distribution we're running on. | ||
let release = child_process.execSync('cat /etc/*-release').toString().toLowerCase(); | ||
|
||
if (release.indexOf('ubuntu') >= 0) { | ||
return SupportedPlatform.Ubuntu; | ||
} | ||
else if (release.indexOf('centos') >= 0) { | ||
return SupportedPlatform.CentOS; | ||
} | ||
else if (release.indexOf('rhel') >= 0) { | ||
return SupportedPlatform.RHEL; | ||
} | ||
else if (release.indexOf('debian') >= 0) { | ||
return SupportedPlatform.Debian; | ||
} | ||
} | ||
|
||
return SupportedPlatform.None; | ||
} |