Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/core.func
Original file line number Diff line number Diff line change
Expand Up @@ -2490,7 +2490,8 @@ cleanup_lxc() {
rm -rf /root/.npm/_cacache /root/.npm/_logs 2>/dev/null || true
fi
if command -v yarn &>/dev/null; then
rm -rf /root/.cache/yarn /root/.yarn/cache 2>/dev/null || true
# yarn 1 run as root caches under /usr/local/share, not in $HOME
rm -rf /root/.cache/yarn /root/.yarn/cache /root/.yarn/berry/cache /usr/local/share/.cache/yarn 2>/dev/null || true
fi
if command -v pnpm &>/dev/null; then
pnpm store prune &>/dev/null || true
Expand Down
2 changes: 2 additions & 0 deletions tests/install-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@ result=$(
check "no apt-get: cleanup_lxc cleans through pkg_clean" "pkg_clean" "$result"
check "install.func does not shadow core.func's cleanup_lxc" "" "$(grep -n '^cleanup_lxc()' "$CORE_DIR/lxc/install.func" || true)"

check "cleanup_lxc clears yarn 1's root cache" "1" "$(declare -f cleanup_lxc | grep -c '/usr/local/share/.cache/yarn')"

printf '%s passed, %s failed\n' "$passed" "$failed"
((failed == 0))
Loading