mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 08:45:09 +00:00
Fix test error case
This commit is contained in:
@@ -202,7 +202,6 @@ batch_uninstall_applications() {
|
|||||||
running_apps+=("$app_name")
|
running_apps+=("$app_name")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if it's a Homebrew cask (only if app is symlinked from Caskroom)
|
|
||||||
local cask_name="" is_brew_cask="false"
|
local cask_name="" is_brew_cask="false"
|
||||||
local resolved_path=$(readlink "$app_path" 2> /dev/null || echo "")
|
local resolved_path=$(readlink "$app_path" 2> /dev/null || echo "")
|
||||||
if [[ "$resolved_path" == */Caskroom/* ]]; then
|
if [[ "$resolved_path" == */Caskroom/* ]]; then
|
||||||
@@ -210,6 +209,13 @@ batch_uninstall_applications() {
|
|||||||
local tmp="${resolved_path#*/Caskroom/}"
|
local tmp="${resolved_path#*/Caskroom/}"
|
||||||
cask_name="${tmp%%/*}"
|
cask_name="${tmp%%/*}"
|
||||||
[[ -n "$cask_name" ]] && is_brew_cask="true"
|
[[ -n "$cask_name" ]] && is_brew_cask="true"
|
||||||
|
elif command -v get_brew_cask_name > /dev/null 2>&1; then
|
||||||
|
local detected_cask
|
||||||
|
detected_cask=$(get_brew_cask_name "$app_path" 2> /dev/null || true)
|
||||||
|
if [[ -n "$detected_cask" ]]; then
|
||||||
|
cask_name="$detected_cask"
|
||||||
|
is_brew_cask="true"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if sudo is needed
|
# Check if sudo is needed
|
||||||
|
|||||||
Reference in New Issue
Block a user