Refuse to run if git repo is dirty
This commit is contained in:
parent
3bc0c4e9e8
commit
6728ffeee8
2 changed files with 17 additions and 1 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Fli" Version="1.1000.0" />
|
||||||
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="9.0.1" />
|
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="9.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,17 @@
|
||||||
|
open Fli
|
||||||
|
|
||||||
[<EntryPoint>]
|
[<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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue