From 1ee60405cea89cb04b28305cc843705489b86f73 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 5 Jun 2026 23:13:15 +0200 Subject: [PATCH] Cleanup: clean_node_modules helper, yarn cache clean || true, remove duplicate blocks --- update-Nitrov3.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/update-Nitrov3.sh b/update-Nitrov3.sh index 91849df..db08d4a 100755 --- a/update-Nitrov3.sh +++ b/update-Nitrov3.sh @@ -36,6 +36,14 @@ if [ -n "$DB_PASS" ]; then fi # --------------------- +# Helper: verwijder node_modules geforceerd (met sudo fallback) en herstel directory-eigenaar +clean_node_modules() { + rm -rf node_modules 2>/dev/null || sudo rm -rf node_modules 2>/dev/null || true + if [ "$(stat -c '%U' .)" != "$(whoami)" ] && command -v sudo &> /dev/null; then + sudo chown -R "$(whoami)":"$(whoami)" . + fi +} + echo "=== Starting EPIC WEB CONTROL Update ===" # ---------------------------------------- @@ -93,12 +101,7 @@ cd "$NITRO_RENDERER/" git pull echo "--> Running yarn install for Nitro_Render_V3..." -# Forceer node_modules verwijderen met sudo als normaal rm faalt (permission issues) -rm -rf node_modules 2>/dev/null || sudo rm -rf node_modules 2>/dev/null || true -# Zorg dat de directory schrijfbaar is voor de huidige gebruiker -if [ "$(stat -c '%U' .)" != "$(whoami)" ] && command -v sudo &> /dev/null; then - sudo chown -R "$(whoami)":"$(whoami)" . -fi +clean_node_modules yarn install @@ -111,12 +114,7 @@ cd "$NITRO_CLIENT" git pull echo "--> Running yarn install for Nitro-V3..." -# Forceer node_modules verwijderen met sudo als normaal rm faalt (permission issues) -rm -rf node_modules 2>/dev/null || sudo rm -rf node_modules 2>/dev/null || true -# Zorg dat de directory schrijfbaar is voor de huidige gebruiker -if [ "$(stat -c '%U' .)" != "$(whoami)" ] && command -v sudo &> /dev/null; then - sudo chown -R "$(whoami)":"$(whoami)" . -fi +clean_node_modules yarn install echo "--> Building Nitro-V3 with Vite 8 / Yarn..." @@ -171,7 +169,7 @@ fi # 3. Clean Yarn cache to save SSD space echo "--> Cleaning Yarn cache..." -yarn cache clean +yarn cache clean 2>/dev/null || true # ----------------------------------------