mirror of
https://github.com/tw93/Mole.git
synced 2026-03-22 19:05:07 +00:00
fix(clean): respect whitelist in Homebrew dry-run mode
Show "skipped whitelist" instead of "would cleanup" when Homebrew cache is whitelisted, making dry-run behavior consistent with actual execution.
This commit is contained in:
@@ -5,7 +5,12 @@
|
|||||||
clean_homebrew() {
|
clean_homebrew() {
|
||||||
command -v brew > /dev/null 2>&1 || return 0
|
command -v brew > /dev/null 2>&1 || return 0
|
||||||
if [[ "${DRY_RUN:-false}" == "true" ]]; then
|
if [[ "${DRY_RUN:-false}" == "true" ]]; then
|
||||||
echo -e " ${YELLOW}${ICON_DRY_RUN}${NC} Homebrew · would cleanup and autoremove"
|
# Check if Homebrew cache is whitelisted
|
||||||
|
if is_path_whitelisted "$HOME/Library/Caches/Homebrew"; then
|
||||||
|
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Homebrew · skipped whitelist"
|
||||||
|
else
|
||||||
|
echo -e " ${YELLOW}${ICON_DRY_RUN}${NC} Homebrew · would cleanup and autoremove"
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
# Skip if cleaned recently to avoid repeated heavy operations.
|
# Skip if cleaned recently to avoid repeated heavy operations.
|
||||||
|
|||||||
Reference in New Issue
Block a user