summary refs log tree commit diff stats
path: root/tools
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-01-23 00:45:29 +0100
committerAraq <rumpf_a@web.de>2017-01-23 00:45:29 +0100
commit65dda793359da08d04cf22c91c157985d9b8e152 (patch)
treefb9b69252ad252d35a076e38c7c0eb0e97b0114e /tools
parent26a8364ed7655e6994cb0f24682151ea8539820f (diff)
downloadNim-65dda793359da08d04cf22c91c157985d9b8e152.tar.gz
downloader: unzip to dist/ directory
Diffstat (limited to 'tools')
-rw-r--r--tools/downloader.nim9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/downloader.nim b/tools/downloader.nim
index 9b7f4a129..dc7b636aa 100644
--- a/tools/downloader.nim
+++ b/tools/downloader.nim
@@ -27,8 +27,13 @@ proc download(pkg: string; c: Controls) {.async.} =
   # XXX make this async somehow:
   writeFile(z, contents)
   c.bar.value = 100
-  if os.execShellCmd("7zG x " & z) != 0:
-    c.lab.text = "Unpacking failed: " & z
+  let olddir = getCurrentDir()
+  try:
+    setCurrentDir(olddir  / "dist")
+    if os.execShellCmd("bin\\7zG.exe x " & pkg & ".zip") != 0:
+      c.lab.text = "Unpacking failed: " & z
+  finally:
+    setCurrentdir(olddir)
 
   when false:
     var a: ZipArchive