all repos — hastysite @ 5eb0cf822356d7cb2512f9724a8ac46709db302b

A high-performance static site generator.

Now cleaning output directory as well.
h3rald h3rald@h3rald.com
Sun, 06 Nov 2016 21:00:42 +0100
commit

5eb0cf822356d7cb2512f9724a8ac46709db302b

parent

8cbb70edff18e18a1d7ebabde109e773c9fa4626

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

jump to
M hastysite.nimhastysite.nim

@@ -191,8 +191,8 @@ return json[key].getStr

else: return default -proc confirmClean(hs: HastySite): bool = - stdout.write("Delete directory '$1' and all its contents? [Y/n] " % hs.dirs.temp) +proc confirmDeleteDir(hs: HastySite, dir: string): bool = + stdout.write("Delete directory '$1' and all its contents? [Y/n] " % dir) let confirm = $stdin.readChar return confirm == "\n" or confirm == "Y" or confirm == "y"

@@ -344,14 +344,14 @@ hs.build()

of "clean": quitIfNotExists(cfg) var hs = newHastySite(cfg) - if hs.confirmClean(): + if hs.confirmDeleteDir(hs.dirs.temp) and hs.confirmDeleteDir(hs.dirs.output): hs.clean() else: quit("Aborted.") of "rebuild": quitIfNotExists(cfg) var hs = newHastySite(cfg) - if hs.confirmClean(): + if hs.confirmDeleteDir(hs.dirs.temp) and hs.confirmDeleteDir(hs.dirs.output): hs.clean() hs.build() else: