OpenDroneMap-WebODM/app/management/commands/rebuildplugins.py

27 wiersze
861 B
Python
Czysty Zwykły widok Historia

import os
import shutil
import glob
from django.core.management.base import BaseCommand
from app.plugins import build_plugins
def cleanup():
# Delete all node_modules and build directories within plugins' public/ folders
root = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", ".."))
2021-06-17 17:39:32 +00:00
for d in glob.glob(os.path.join(root, "coreplugins", "**", "public", "node_modules")):
shutil.rmtree(d)
print("R\t" + d)
2021-06-17 17:39:32 +00:00
for d in glob.glob(os.path.join(root, "coreplugins", "**", "public", "build")):
shutil.rmtree(d)
print("R\t" + d)
print("Cleanup done!")
class Command(BaseCommand):
2021-05-27 13:55:27 +00:00
requires_system_checks = []
def add_arguments(self, parser):
super(Command, self).add_arguments(parser)
def handle(self, **options):
cleanup()
build_plugins()