From 0e8d053ba0348c27b192ab7bcb0a22f7e29c6679 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:28:04 +0100 Subject: [PATCH] Simplify npm cache cleanup logic in cleanup_lxc Replaced the if-statement for npm cache cleaning with a single command using '||' to fall back to manual cache removal if 'npm cache clean' fails. This streamlines the cleanup process. --- misc/core.func | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/misc/core.func b/misc/core.func index 8bc8d5791..c1c4efddc 100644 --- a/misc/core.func +++ b/misc/core.func @@ -819,9 +819,7 @@ cleanup_lxc() { if command -v npm &>/dev/null; then $STD npm cache verify 2>/dev/null || true # Clean cache with fallback to manual removal if command fails - if ! $STD npm cache clean --force 2>/dev/null; then - rm -rf /root/.npm/_cacache 2>/dev/null || true - fi + $STD npm cache clean --force 2>/dev/null || rm -rf /root/.npm/_cacache 2>/dev/null || true fi # Node.js yarn if command -v yarn &>/dev/null; then $STD yarn cache clean || true; fi