Skip to content

Commit

Permalink
Merge pull request #1651 from FelschR/patch-1
Browse files Browse the repository at this point in the history
make platform identification POSIX-compliant
  • Loading branch information
filipw authored Nov 15, 2019
2 parents cbfca2c + 2e37c48 commit 9544671
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/OmniSharp.Shared/Utilities/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ private static Platform GetCurrentPlatform()
}
else
{
// If this is not Windows, run 'uname' on Bash to get the OS name and architecture.
var output = RunOnBashAndCaptureOutput("uname", "-s -m");
// If this is not Windows, run 'uname' on a POSIX shell to get the OS name and architecture.
var output = RunOnShellAndCaptureOutput("uname", "-s -m");
if (string.IsNullOrEmpty(output))
{
return new Platform();
Expand Down Expand Up @@ -126,7 +126,7 @@ private static Platform GetCurrentPlatform()

private static Version GetMacOSVersion()
{
var versionText = RunOnBashAndCaptureOutput("sw_vers", "-productVersion");
var versionText = RunOnShellAndCaptureOutput("sw_vers", "-productVersion");
return ParseVersion(versionText);
}

Expand Down Expand Up @@ -191,7 +191,7 @@ private static Version ParseVersion(string versionText)
return null;
}

private static string RunOnBashAndCaptureOutput(string fileName, string arguments)
=> ProcessHelper.RunAndCaptureOutput("/bin/bash", $"-c '{fileName} {arguments}'");
private static string RunOnShellAndCaptureOutput(string fileName, string arguments)
=> ProcessHelper.RunAndCaptureOutput("/bin/sh", $"-c '{fileName} {arguments}'");
}
}

0 comments on commit 9544671

Please sign in to comment.