diff --git a/prosopopoee b/prosopopoee index a96597d..f047901 100755 --- a/prosopopoee +++ b/prosopopoee @@ -3,6 +3,7 @@ import os import sys import yaml +import shutil from jinja2 import Environment, FileSystemLoader @@ -35,6 +36,13 @@ def main(): error(dirs, "I can't find at least one directory with a settings.yaml in the current working directory, you don't have any gallery?") + if not os.path.exists("build"): + os.makedirs("build") + + # XXX recursively merge directories + 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")) + for gallery in dirs: gallery_settings = yaml.safe_load(open(os.path.join(os.getcwd(), gallery, "settings.yaml"), "r"))