diff --git a/core/core.func b/core/core.func index 17f5ffa..f4faa6f 100644 --- a/core/core.func +++ b/core/core.func @@ -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 diff --git a/tests/install-cleanup.sh b/tests/install-cleanup.sh index c19d4dc..0397c76 100644 --- a/tests/install-cleanup.sh +++ b/tests/install-cleanup.sh @@ -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))