Skip to content

Commit ff0a1cb

Browse files
committed
chore: fixes cache cleaning
While working on the monorepo continuous benchmark we noticed that the script that is used here to clean cache folders might not be working as expected. This change ensures that the cache folders are cleaned up as expected.
1 parent 66c2ec7 commit ff0a1cb

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

scripts/clean-helpers.sh

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,23 @@ clean_berry_cache() {
3232
clean_pnpm_cache() {
3333
if command -v corepack &> /dev/null; then
3434
corepack pnpm cache delete * --silent || true
35-
if [ -n "$(corepack pnpm store path 2>/dev/null)" ]; then
36-
safe_remove "$(corepack pnpm store path)"
37-
fi
35+
safe_remove "$(corepack pnpm store path | xargs)"
3836
fi
3937
}
4038

4139
# Function to safely clean vlt cache
4240
clean_vlt_cache() {
4341
if command -v vlt &> /dev/null; then
44-
if [ -n "$(vlt config get cache 2>/dev/null)" ]; then
45-
safe_remove "$(vlt config get cache)"
46-
fi
42+
safe_remove "$(vlt config get cache | xargs)"
4743
fi
4844
}
4945

5046
# Function to safely clean bun cache
5147
clean_bun_cache() {
5248
if command -v bun &> /dev/null; then
53-
if [ -n "$(bun pm cache 2>/dev/null)" ]; then
54-
bun pm cache rm || true
55-
# also clear global cache dir
56-
safe_remove "~/.bun/install/cache"
57-
fi
49+
bun pm cache rm || true
50+
# also clear global cache dir
51+
safe_remove "~/.bun/install/cache"
5852
fi
5953
}
6054

0 commit comments

Comments
 (0)