From 65dda793359da08d04cf22c91c157985d9b8e152 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 23 Jan 2017 00:45:29 +0100 Subject: [PATCH] downloader: unzip to dist/ directory --- tools/downloader.nim | 9 +++++++-- 1 file 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