Browse Source

Merge pull request #471 from amesgen/theme-dir-writable

Make theme dir writable after copying to it
pull/479/head
Simon Conseil 4 years ago committed by GitHub
parent
commit
35d42e9904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      sigal/writer.py

10
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(

Loading…
Cancel
Save