diff --git a/sigal/writer.py b/sigal/writer.py index c7125df..97a0a38 100644 --- a/sigal/writer.py +++ b/sigal/writer.py @@ -24,6 +24,7 @@ import importlib import logging import os import shutil +import stat import sys import types @@ -105,6 +106,15 @@ class AbstractWriter: ): shutil.copytree(static_path, self.theme_path, dirs_exist_ok=True) + # Ensure that the theme dir is writeable + for root, _, files in os.walk(self.theme_path): + st = os.stat(root) + os.chmod(root, st.st_mode | stat.S_IWUSR) + for name in files: + path = os.path.join(root, name) + st = os.stat(path) + os.chmod(path, st.st_mode | stat.S_IWUSR) + if self.settings["user_css"]: if not os.path.exists(self.settings["user_css"]): self.logger.error(