From 7cbe86c6538565086e0c8449e509edc4e0cbb7bf Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 19 Feb 2016 17:39:17 +0100 Subject: [PATCH] [fix] enable add static files --- prosopopee/prosopopee.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 8cd10c1..4dc876b 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -118,7 +118,10 @@ def main(): # XXX recursively merge directories if os.path.exists(os.path.join(os.getcwd(), "build", "static")): shutil.rmtree(os.path.join(os.getcwd(), "build", "static")) - shutil.copytree(os.path.join(os.path.split(os.path.realpath(__file__))[0], "static"), os.path.join(os.getcwd(), "build", "static")) + if os.path.exists(os.path.join(os.getcwd(), "static")): + shutil.copytree(os.path.join(os.getcwd(), "static"), os.path.join(os.getcwd(), "build", "static")) + else: + shutil.copytree(os.path.join(os.path.split(os.path.realpath(__file__))[0], "static"), os.path.join(os.getcwd(), "build", "static")) for gallery in dirs: gallery_settings = yaml.safe_load(open(os.path.join(os.getcwd(), gallery, "settings.yaml"), "r"))