Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent false-positive in EnvironmentHelper.isMacOS on Windows #1204

Merged
merged 1 commit into from
Apr 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/app/FakeLib/EnvironmentHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,13 @@ let isUnix = Environment.OSVersion.Platform = PlatformID.Unix
/// Determines if the current system is a MacOs system
let isMacOS =
(Environment.OSVersion.Platform = PlatformID.MacOSX) ||
// osascript is the AppleScript interpreter on OS X
File.Exists "/usr/bin/osascript"
// Running on OSX with mono, Environment.OSVersion.Platform returns Unix
// rather than MacOSX, so check for osascript (the AppleScript
// interpreter). Checking for osascript for other platforms can cause a
// problem on Windows if the current-directory is on a mapped-drive
// pointed to a Mac's root partition; e.g., Parallels does this to give
// Windows virtual machines access to files on the host.
(Environment.OSVersion.Platform = PlatformID.Unix && (File.Exists "/usr/bin/osascript"))

/// Determines if the current system is a Linux system
let isLinux = int System.Environment.OSVersion.Platform |> fun p -> (p = 4) || (p = 6) || (p = 128)
Expand Down