Skip to content

Instantly share code, notes, and snippets.

@OnurGumus
Created October 5, 2024 21:02
Show Gist options
  • Save OnurGumus/4e8df341767962c11f880f72fcd0e08a to your computer and use it in GitHub Desktop.
Save OnurGumus/4e8df341767962c11f880f72fcd0e08a to your computer and use it in GitHub Desktop.
Fixes generated fsi references
open System.IO
let lines = File.ReadAllLines "references.fsx"
let fixedLines = lines |> Array.map (fun line ->
if line.StartsWith("#r") then
if line.Contains("/usr/share/dotnet/packs/") then
line.Replace("/packs/", "/shared/")
.Replace(".Ref/","/")
.Replace("/ref/net8.0/", "/")
else if line.Contains("/obj/") || line.Contains("/bin") then
line.Replace("/ref/", "/")
else
line.Replace("/ref/", "/lib/")
else
line
)
File.WriteAllLines("references-fixed.fsx", fixedLines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment