Refuse to run if git repo is dirty

This commit is contained in:
Sven van Heugten 2026-05-12 06:37:08 +02:00
parent 3bc0c4e9e8
commit 6728ffeee8
No known key found for this signature in database
GPG key ID: D612F88666F4F660
2 changed files with 17 additions and 1 deletions

View file

@ -11,6 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fli" Version="1.1000.0" />
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="9.0.1" />
</ItemGroup>
</Project>

View file

@ -1,2 +1,17 @@
open Fli
[<EntryPoint>]
let main argv = 0
let main argv =
let gitState =
cli {
Exec "git"
Arguments [ "status"; "--porcelain" ]
}
|> Command.execute
|> Output.throwIfErrored
if gitState.Text <> None then
eprintfn "Uncommitted changes. Refusing to run."
exit 1
0