From 949cbc9646856ea1f93eba30441b271b99beff75 Mon Sep 17 00:00:00 2001 From: Zaid Date: Sun, 6 Jun 2021 15:17:48 +0200 Subject: [PATCH] Ubik v3.37 handle fsx files --- src/Ubik/Program.fs | 14 +++++++++----- src/Ubik/Ubik.fsproj | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Ubik/Program.fs b/src/Ubik/Program.fs index 8b4cfef..9d91d24 100644 --- a/src/Ubik/Program.fs +++ b/src/Ubik/Program.fs @@ -32,7 +32,8 @@ let getProject (args: string []) = |> function | Some project -> project | None -> - Directory.GetFiles(Environment.CurrentDirectory, "*.fs") + Directory.GetFiles(Environment.CurrentDirectory, "*.*") + |> Array.filter (fun file -> file.EndsWith ".fsx" || file.EndsWith ".fs") |> Array.map File |> Files @@ -48,12 +49,13 @@ let getProject (args: string []) = |> function | Some project -> project | None -> - Directory.GetFiles(Environment.CurrentDirectory, "*.fs") + Directory.GetFiles(Environment.CurrentDirectory, "*.*") + |> Array.filter (fun file -> file.EndsWith ".fsx" || file.EndsWith ".fs") |> Array.map File |> Files else multipleArgs - |> Array.filter (fun file -> file.EndsWith ".fs") + |> Array.filter (fun file -> file.EndsWith ".fs" || file.EndsWith ".fsx") |> Array.map (fun file -> try File (resolveFile file) with _ -> InvalidFile file) |> Files @@ -180,8 +182,10 @@ let main argv = let fsharpFileNodes = document.GetElementsByTagName("Compile") analyzeFiles [| - for item in 0 .. fsharpFileNodes.Count - 1 -> + for item in 0 .. fsharpFileNodes.Count - 1 do let relativePath = fsharpFileNodes.[item].Attributes.["Include"].InnerText let projectParent = Directory.GetParent project - File(Path.Combine(projectParent.FullName, relativePath)) + let filePath = Path.Combine(projectParent.FullName, relativePath) + if filePath.EndsWith ".fs" || filePath.EndsWith ".fsx" + then File(filePath) |] diff --git a/src/Ubik/Ubik.fsproj b/src/Ubik/Ubik.fsproj index f430543..7776f5a 100644 --- a/src/Ubik/Ubik.fsproj +++ b/src/Ubik/Ubik.fsproj @@ -7,8 +7,8 @@ true true Major - 3.26.0 - Allow the SQL parser to handle comments + 3.27.0 + Handle fsx files