Fix cleanup issues in npm cache and rustup toolchain (#10107)

Issue 1 - BentoPDF (npm cache clean failure):
- npm cache clean --force can fail with ENOTEMPTY on corrupted caches
- Added npm cache verify before clean to detect/fix corruption
- Explicitly redirect stderr to suppress error noise

Issue 2 - Linkwarden (rustup toolchain removed too early):
- Script deleted ~/.rustup during build cleanup
- Later cleanup_lxc() tried to run 'cargo clean' without toolchain
- Now only remove cargo cache dirs, preserve ~/.rustup toolchain

Files changed:
- misc/core.func (cleanup_lxc function)
- install/linkwarden-install.sh (install script)
- ct/linkwarden.sh (update function)

Both changes improve reliability of container cleanup process.
This commit is contained in:
CanbiZ (MickLesk)
2025-12-18 11:32:30 +01:00
committed by GitHub
parent fdb722fae3
commit 21e0a8fced
3 changed files with 6 additions and 3 deletions

View File

@@ -816,7 +816,10 @@ cleanup_lxc() {
fi
# Node.js npm
if command -v npm &>/dev/null; then $STD npm cache clean --force || true; fi
if command -v npm &>/dev/null; then
$STD npm cache verify 2>/dev/null || true
$STD npm cache clean --force 2>/dev/null || true
fi
# Node.js yarn
if command -v yarn &>/dev/null; then $STD yarn cache clean || true; fi
# Node.js pnpm