all repos — nifty @ 0124ed4b0fe133930e34931e94ce6e3455414a77

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

0124ed4b0fe133930e34931e94ce6e3455414a77

parent

d6cf95687fa881c3ae12ac209d10b69e53121507

1 files changed, 6 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,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)