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

Content/build.fsx: use CreateProcess #32

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
10 changes: 9 additions & 1 deletion Content/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ open Fake.DotNet
open Fake.IO
open System.Threading

open System.Runtime.InteropServices

let appPath = "./src/SaturnServer/" |> Path.getFullName
let projectPath = Path.combine appPath "SaturnServer.fsproj"

Expand All @@ -27,7 +29,13 @@ Target.create "Run" (fun _ ->
}
let browser = async {
Thread.Sleep 5000
Process.start (fun i -> { i with FileName = "http://localhost:8085" }) |> ignore

if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then
CreateProcess.fromRawCommand "cmd.exe" [ "/C"; "start http://localhost:8085" ] |> Proc.run |> ignore
elif RuntimeInformation.IsOSPlatform(OSPlatform.Linux) then
CreateProcess.fromRawCommand "xdg-open" [ "http://localhost:8085" ] |> Proc.run |> ignore
elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then
CreateProcess.fromRawCommand "open" [ "http://localhost:8085" ] |> Proc.run |> ignore
}

[ server; browser]
Expand Down