Skip to content

Commit

Permalink
Merge pull request #963 from nosami/mono-el-capitan
Browse files Browse the repository at this point in the history
Don't assume that mono is on the path for El Capitan
  • Loading branch information
forki committed Oct 2, 2015
2 parents 64e3ffe + 4e77273 commit 19e553c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/app/FakeLib/EnvironmentHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,20 @@ let isLinux = int System.Environment.OSVersion.Platform |> fun p -> (p = 4) || (
/// Todo: Detect mono on windows
let isMono = isLinux || isUnix || isMacOS

let monoPath =
if isMacOS && File.Exists "/Library/Frameworks/Mono.framework/Commands/mono" then
"/Library/Frameworks/Mono.framework/Commands/mono"
else
"mono"

/// Arguments on the Mono executable
let mutable monoArguments = ""

/// Modifies the ProcessStartInfo according to the platform semantics
let platformInfoAction (psi : ProcessStartInfo) =
if isMono && psi.FileName.EndsWith ".exe" then
psi.Arguments <- monoArguments + " " + psi.FileName + " " + psi.Arguments
psi.FileName <- "mono"
psi.FileName <- monoPath

/// The path of the current target platform
let mutable TargetPlatformPrefix =
Expand Down
2 changes: 1 addition & 1 deletion src/app/FakeLib/ProcessHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let startedProcesses = HashSet()
let start (proc : Process) =
if isMono && proc.StartInfo.FileName.ToLowerInvariant().EndsWith(".exe") then
proc.StartInfo.Arguments <- "--debug \"" + proc.StartInfo.FileName + "\" " + proc.StartInfo.Arguments
proc.StartInfo.FileName <- "mono"
proc.StartInfo.FileName <- monoPath

proc.Start() |> ignore
startedProcesses.Add(proc.Id, proc.StartTime) |> ignore
Expand Down

0 comments on commit 19e553c

Please sign in to comment.