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

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