Created
October 5, 2024 21:02
-
-
Save OnurGumus/4e8df341767962c11f880f72fcd0e08a to your computer and use it in GitHub Desktop.
Fixes generated fsi references
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
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