Merge pull request #471 from amesgen/theme-dir-writable
Make theme dir writable after copying to it
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user