File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,23 @@ clean_dev_npm() {
9191 safe_clean ~ /.tnpm/_cacache/* " tnpm cache directory"
9292 safe_clean ~ /.tnpm/_logs/* " tnpm logs"
9393 safe_clean ~ /.yarn/cache/* " Yarn cache"
94- safe_clean ~ /.bun/install/cache/* " Bun cache"
94+
95+ # Bun cache - check if bun is installed and usable
96+ if command -v bun > /dev/null 2>&1 && bun --version > /dev/null 2>&1 ; then
97+ clean_tool_cache " bun cache" bun pm cache rm
98+ local bun_cache_path
99+ start_section_spinner " Checking bun cache path..."
100+ bun_cache_path=$( run_with_timeout 2 bun pm cache 2> /dev/null) || bun_cache_path=" "
101+ stop_section_spinner
102+ # If custom cache path, also clean orphaned default location
103+ if [[ -n " $bun_cache_path " && " $bun_cache_path " != " $HOME /.bun/install/cache" ]]; then
104+ safe_clean ~ /.bun/install/cache/* " Orphaned bun cache"
105+ fi
106+ else
107+ # bun not installed, just clean the default cache directory
108+ safe_clean ~ /.bun/install/cache/* " bun cache"
109+ fi
110+ note_activity
95111}
96112# Python/pip ecosystem caches.
97113clean_dev_python () {
You can’t perform that action at this time.
0 commit comments