Skip to content

Commit

Permalink
Ubik v3.37 handle fsx files
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid-Ajaj committed Jun 6, 2021
1 parent 1d1a3ea commit 949cbc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions src/Ubik/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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)
|]
4 changes: 2 additions & 2 deletions src/Ubik/Ubik.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<PackAsTool>true</PackAsTool>
<IsPackable>true</IsPackable>
<RollForward>Major</RollForward>
<Version>3.26.0</Version>
<PackageReleaseNotes>Allow the SQL parser to handle comments</PackageReleaseNotes>
<Version>3.27.0</Version>
<PackageReleaseNotes>Handle fsx files</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 949cbc9

Please sign in to comment.