mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Only symlink to frontend directory contents instead of copying them
This commit is contained in:
committed by
Antoine Nguyen
parent
ff1e2b68be
commit
a4c537231b
@@ -145,9 +145,14 @@ class Command(BaseCommand):
|
||||
os.path.dirname(__file__), "../../../frontend_dist/"
|
||||
)
|
||||
frontend_target_dir = f"{settings.BASE_DIR}/frontend"
|
||||
if os.path.exists(base_frontend_dir):
|
||||
if os.path.isdir(base_frontend_dir):
|
||||
shutil.rmtree(frontend_target_dir, ignore_errors=True)
|
||||
shutil.copytree(base_frontend_dir, frontend_target_dir)
|
||||
os.makedirs(frontend_target_dir, exist_ok=True)
|
||||
for entry in os.scandir(base_frontend_dir):
|
||||
if entry.name != "config.json":
|
||||
os.symlink(f"{base_frontend_dir}/{entry.name}",
|
||||
f"{frontend_target_dir}/{entry.name}",
|
||||
target_is_directory=entry.is_dir())
|
||||
with open(f"{frontend_target_dir}/config.json", "w") as fp:
|
||||
fp.write(
|
||||
f"""{{
|
||||
|
||||
Reference in New Issue
Block a user