Minor fixes; added curl support.
h3rald h3rald@h3rald.com
Wed, 15 Feb 2017 19:30:58 +0100
1 files changed,
6 insertions(+),
1 deletions(-)
jump to
M
lib/project.nim
→
lib/project.nim
@@ -30,6 +30,9 @@ createDir(prj.dir/prj.storage)
var o = newJObject() o["storage"] = %prj.storage o["commands"] = newJObject() + o["commands"]["get"] = newJObject() + o["commands"]["get"]["curl+src+name"] = newJObject() + o["commands"]["get"]["curl+src+name"]["cmd"] = %"curl {{src}} -o {{name}}" o["commands"]["install"] = newJObject() o["commands"]["install"]["git+src"] = newJObject() o["commands"]["install"]["git+src"]["cmd"] = %"git clone {{src}} --depth 1"@@ -128,11 +131,13 @@ warn "Command '$1' not available for package '$2'" % [command, alias]
setCurrentDir(prj.dir) proc executeRec*(prj: var NiftyProject, command, alias: string) = + let pwd = getCurrentDir(); if (execute(prj, command, alias) != 0): return - var pwd = getCurrentDir(); var childProj = newNiftyProject(pwd/prj.storage/alias) if childProj.configured: childProj.load() + setCurrentDir(childProj.dir) for key, val in childProj.packages.pairs: childProj.executeRec(command, key) + setCurrentDir(pwd)