Handling unzip destination dir properly (ref: #177).
h3rald h3rald@h3rald.com
Wed, 29 Dec 2021 13:53:13 +0000
1 files changed,
2 insertions(+),
3 deletions(-)
jump to
M
minpkg/lib/min_sys.nim
→
minpkg/lib/min_sys.nim
@@ -177,9 +177,8 @@ def.symbol("unzip") do (i: In):
let vals = i.expect("'sym", "'sym") var dir = vals[0].getString let f = vals[1].getString - if dir.len < 1: - raiseInvalid("No destination directory was specified.") - if dir[0] != '.' and dir.len > 1 and dir[1] != '/': + dir = dir.unix + if not dir.contains("/"): dir = "./" & dir extractAll(f, dir)