Commit 9041fd8f authored by shadMod's avatar shadMod 💬

cp tree path from 'assets/news' to 'data/news'

parent 23641322
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import os import os
import flask import flask
import shutil
from . import actions from . import actions
from . import auth from . import auth
...@@ -29,6 +29,7 @@ from . import pages ...@@ -29,6 +29,7 @@ from . import pages
from . import redirects from . import redirects
from . import utils from . import utils
from .src.news import news from .src.news import news
from .constants import BASE_DIR
def create_app(data_path, debug=False): def create_app(data_path, debug=False):
...@@ -92,6 +93,11 @@ def init_data_directory(data_path: str): ...@@ -92,6 +93,11 @@ def init_data_directory(data_path: str):
for _dir in dirs: for _dir in dirs:
os.makedirs(os.path.join(data_path, _dir), exist_ok=True) os.makedirs(os.path.join(data_path, _dir), exist_ok=True)
# Copy news tree dirs and file
ROOT_NEWS = os.path.join(BASE_DIR, "assets/news")
NEWS_PATH = os.path.join(data_path, "news")
shutil.copytree(ROOT_NEWS, NEWS_PATH, dirs_exist_ok=True)
# Initialize the cache # Initialize the cache
static_dirs = {"static": "+assets"} static_dirs = {"static": "+assets"}
for src, dest in static_dirs.items(): for src, dest in static_dirs.items():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment