From d76f183cff1ba8cc24148a056aaa88bb84a1684a Mon Sep 17 00:00:00 2001 From: LongHairedHacker Date: Thu, 17 Nov 2016 18:54:15 +0100 Subject: [PATCH] Moved warning to right place --- verdandi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/verdandi.py b/verdandi.py index 5e68402..029d750 100644 --- a/verdandi.py +++ b/verdandi.py @@ -55,6 +55,10 @@ class Verdandi(object): def collect_assets(self): + if not os.path.exists(self.output_directory): + os.mkdir(self.output_directory) + if os.listdir(self.output_directory) != []: + print "[Warn] Ouput directory is not empty" for module in self.modules: module.collect_assets(self.output_directory) @@ -62,8 +66,6 @@ class Verdandi(object): def render(self): if not os.path.exists(self.output_directory): os.mkdir(self.output_directory) - if os.listdir(self.output_directory) != []: - print "[Warn] Ouput directory is not empty" for module in self.modules: module.render(self.output_directory, self.jinja_env)