all repos — nifty @ 3c3b2a19955335e0a3dc89c9840e6c7c23ce7fe9

A tiny (pseudo) package manager and script runner.

Minor fixes; added curl support.
h3rald h3rald@h3rald.com
Wed, 15 Feb 2017 19:30:58 +0100
commit

3c3b2a19955335e0a3dc89c9840e6c7c23ce7fe9

parent

d6cf95687fa881c3ae12ac209d10b69e53121507

1 files changed, 8 insertions(+), 1 deletions(-)

jump to
M lib/project.nimlib/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,15 @@ 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) + info "--> REC: ", alias for key, val in childProj.packages.pairs: + info "--> ", key childProj.executeRec(command, key) + setCurrentDir(pwd)