mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-01 21:30:09 +00:00
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.
This commit is contained in:
parent
f0f0a63f6c
commit
0e8d053ba0
1 changed files with 1 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue