summary refs log tree commit diff stats
path: root/koch.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-04 19:55:10 +0200
committerAraq <rumpf_a@web.de>2018-08-04 19:55:23 +0200
commit1fa23e347eb6e61b7f0f1999c6802a60fdf213a8 (patch)
tree73a77386a77c3e15e6a361afbdee0ea4d28d6e68 /koch.nim
parent8d2953e8051fb623edccb7ad2946d079f3655e95 (diff)
downloadNim-1fa23e347eb6e61b7f0f1999c6802a60fdf213a8.tar.gz
make 'koch xz' enforce a clean 'git diff'; fixes #7292
Diffstat (limited to 'koch.nim')
-rw-r--r--koch.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/koch.nim b/koch.nim
index 133c7e32b..ad6a774e8 100644
--- a/koch.nim
+++ b/koch.nim
@@ -242,7 +242,15 @@ proc zip(args: string) =
   exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim zip compiler/installer.ini" %
        ["tools/niminst/niminst".exe, VersionAsString])
 
+proc ensureCleanGit() =
+   let (outp, status) = osproc.execCmdEx("git diff")
+   if outp.len != 0:
+     quit "Not a clean git repository; 'git diff' not empty!"
+   if status != 0:
+     quit "Not a clean git repository; 'git diff' returned non-zero!"
+
 proc xz(args: string) =
+  ensureCleanGit()
   bundleNimbleSrc()
   bundleNimsuggest(false)
   nimexec("cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %