mirror of
https://github.com/tw93/Mole.git
synced 2026-02-11 09:29:20 +00:00
Merge branch 'main' of github.com:tw93/Mole
This commit is contained in:
@@ -196,15 +196,15 @@ batch_uninstall_applications() {
|
|||||||
local exec_name=""
|
local exec_name=""
|
||||||
local info_plist="$app_path/Contents/Info.plist"
|
local info_plist="$app_path/Contents/Info.plist"
|
||||||
if [[ -e "$info_plist" ]]; then
|
if [[ -e "$info_plist" ]]; then
|
||||||
exec_name=$(defaults read "$info_plist" CFBundleExecutable 2>/dev/null || echo "")
|
exec_name=$(defaults read "$info_plist" CFBundleExecutable 2> /dev/null || echo "")
|
||||||
fi
|
fi
|
||||||
if pgrep -qx "${exec_name:-$app_name}" 2>/dev/null; then
|
if pgrep -qx "${exec_name:-$app_name}" 2> /dev/null; then
|
||||||
running_apps+=("$app_name")
|
running_apps+=("$app_name")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if it's a Homebrew cask (only if app is symlinked from Caskroom)
|
# 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
|
||||||
# Extract cask name using bash parameter expansion (faster than sed)
|
# Extract cask name using bash parameter expansion (faster than sed)
|
||||||
local tmp="${resolved_path#*/Caskroom/}"
|
local tmp="${resolved_path#*/Caskroom/}"
|
||||||
|
|||||||
Reference in New Issue
Block a user