1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-05 02:09:43 +00:00

Compatible with the use of GNU CoreUtils

This commit is contained in:
Tw93
2025-11-27 07:28:37 +09:00
parent 5530bbe0e5
commit 0edd6f1562
3 changed files with 94 additions and 285 deletions

View File

@@ -71,7 +71,7 @@ batch_uninstall_applications() {
fi
# Check if app requires sudo to delete
if [[ ! -w "$(dirname "$app_path")" ]] || [[ "$(stat -f%Su "$app_path" 2> /dev/null)" == "root" ]]; then
if [[ ! -w "$(dirname "$app_path")" ]] || [[ "$(get_file_owner "$app_path")" == "root" ]]; then
sudo_apps+=("$app_name")
fi
@@ -193,7 +193,7 @@ batch_uninstall_applications() {
local related_files=$(decode_file_list "$encoded_files" "$app_name")
local reason=""
local needs_sudo=false
[[ ! -w "$(dirname "$app_path")" || "$(stat -f%Su "$app_path" 2> /dev/null)" == "root" ]] && needs_sudo=true
[[ ! -w "$(dirname "$app_path")" || "$(get_file_owner "$app_path")" == "root" ]] && needs_sudo=true
if ! force_kill_app "$app_name" "$app_path"; then
reason="still running"
fi