Skip to content
Snippets Groups Projects
Commit fa6222e9 authored by Kevin Schneider's avatar Kevin Schneider
Browse files

4

parent 03a3d09c
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,9 @@ let executeProcess (processName: string) (processArgs: string) =
{ ExitCode = proc.ExitCode; StdOut = output.ToString(); StdErr = error.ToString() }
let changed_files = File.ReadAllLines("file_changes.txt") |> set
let changed_files = File.ReadAllLines("file_changes.txt") |> set |> Set.map (fun x -> x.Replace('\\',Path.DirectorySeparatorChar).Replace('/',Path.DirectorySeparatorChar))
printfn "parsed changed files as: \r\n%A" changed_files
type ValidationPackageIndex =
{
......@@ -36,11 +38,14 @@ type ValidationPackageIndex =
Directory.GetFiles("validation_packages", "*.fsx")
|> Array.map (fun package ->
if changed_files.Contains(package) then
printfn $"{package} was changed in this commit."
{ Name = package; LastUpdated = System.DateTime.Now}
else
printfn $"{package} was changed in this commit."
let history = executeProcess "git" $"log -1 --pretty=format:%%ci {package}"
{ Name = package; LastUpdated = System.DateTime.ParseExact(history.StdOut.Split(" ").[0], "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)}
printfn $"{package} was not changed in this commit."
printfn $"getting history for {package}"
let history = executeProcess "git" $"log -1 --pretty=format:'%%ci' {package}"
printfn $"history is {history.StdOut}"
{ Name = package; LastUpdated = System.DateTime.ParseExact(history.StdOut.Split(" ").[0].Replace("'",""), "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)}
)
|> fun packages -> JsonSerializer.Serialize(packages)
|> fun json -> File.WriteAllText("validation_packages.json", json)
......
[{"Name":"validation_packages\\package1.fsx","LastUpdated":"2023-07-14T00:00:00"},{"Name":"validation_packages\\package2.fsx","LastUpdated":"2023-07-14T00:00:00"},{"Name":"validation_packages\\package3.fsx","LastUpdated":"2023-07-14T15:21:30.7226387+02:00"},{"Name":"validation_packages\\package4.fsx","LastUpdated":"2023-07-14T15:21:30.7226476+02:00"}]
\ No newline at end of file
printfn $"hi 3"
//soos
\ No newline at end of file
//xd
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment