From 981353380cc4c14dc9acf269649b7771106fccc8 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 21 Aug 2025 18:12:45 +0200 Subject: [PATCH] plugin python script --- boot.sh | 6 +----- plugin.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 plugin.py diff --git a/boot.sh b/boot.sh index cdb1c6091..589a63cce 100755 --- a/boot.sh +++ b/boot.sh @@ -88,11 +88,7 @@ python manage.py migrate if [ "${PLUGINS_BUILD}" -eq 1 ]; then echo "Running yarn build at startup because PLUGINS_BUILD is enabled" - cd vue3 - npm install --global yarn - yarn install - yarn build - cd .. + python plugin.py fi echo "Collecting static files, this may take a while..." diff --git a/plugin.py b/plugin.py new file mode 100644 index 000000000..e4a7b3106 --- /dev/null +++ b/plugin.py @@ -0,0 +1,19 @@ +import os +import subprocess +import traceback + +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) + +PLUGINS_DIRECTORY = os.path.join(BASE_DIR, 'recipes', 'plugins') +if os.path.isdir(PLUGINS_DIRECTORY): + for d in os.listdir(PLUGINS_DIRECTORY): + if d != '__pycache__': + try: + subprocess.run(['python', 'setup_repo.py'], shell=True, cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', d)) + except Exception: + traceback.print_exc() + print(f'ERROR failed to link plugin {d}') + +subprocess.run(['npm', 'install', '--global', 'yarn'], shell=True, cwd=os.path.join(BASE_DIR, 'vue3')) +subprocess.run(['yarn', 'install'], shell=True, cwd=os.path.join(BASE_DIR, 'vue3')) +subprocess.run(['yarn', 'build'], shell=True, cwd=os.path.join(BASE_DIR, 'vue3'))