all repos — nifty @ 54b9c0c697439168d3e10d641df842c6ecf530bd

A tiny (pseudo) package manager and script runner.

Implemented unmap command.
h3rald h3rald@h3rald.com
Sat, 19 Nov 2016 11:19:25 +0100
commit

54b9c0c697439168d3e10d641df842c6ecf530bd

parent

a08d910d1b8a18aa6729a446472536138cd26798

2 files changed, 14 insertions(+), 0 deletions(-)

jump to
M lib/project.nimlib/project.nim

@@ -60,3 +60,12 @@ prj.packages[alias][key] = val

notice " $1 = $2" % [key, $val] prj.save notice "Package definition '$1' saved." % alias + +proc unmap*(prj: var NiftyProject, alias: string) = + prj.load + if not prj.packages.hasKey alias: + warn "Package definition '$1' not found. Nothing to do." % alias + return + prj.packages.delete(alias) + prj.save + notice "Package definition '$1' removed." % alias
M nifty.nimnifty.nim

@@ -74,6 +74,11 @@ if args.len < 2:

fatal "No alias specified." quit(2) prj.map(args[1], %opts) + of "unmap": + if args.len < 2: + fatal "No alias specified." + quit(2) + prj.unmap(args[1]) else: #TODO echo usage