Last active
May 27, 2020 06:24
-
-
Save kMutagene/f2bab3c532952420a2708c692d3bd022 to your computer and use it in GitHub Desktop.
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
#r "nuget: System.Runtime.InteropServices.RuntimeInformation" | |
///Choose process to open plots with depending on OS. Thanks to @zyzhu for hinting at a solution (https://github.com/muehlhaus/FSharp.Plotly/issues/31) | |
let openOsSpecificFile path = | |
if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then | |
let psi = new System.Diagnostics.ProcessStartInfo(FileName = path, UseShellExecute = true) | |
System.Diagnostics.Process.Start(psi) |> ignore | |
elif RuntimeInformation.IsOSPlatform(OSPlatform.Linux) then | |
System.Diagnostics.Process.Start("xdg-open", path) |> ignore | |
elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then | |
System.Diagnostics.Process.Start("open", path) |> ignore | |
else | |
invalidOp "Not supported OS platform" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment