mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 16:49:41 +00:00
fix: use BSD stat explicitly to avoid GNU coreutils conflict (#160)
This commit is contained in:
@@ -210,9 +210,9 @@ is_recently_modified() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check modification time (macOS compatible)
|
||||
# Get modification time using base.sh helper (handles GNU vs BSD stat)
|
||||
local mod_time
|
||||
mod_time=$(stat -f "%m" "$path" 2> /dev/null || stat -c "%Y" "$path" 2> /dev/null || echo "0")
|
||||
mod_time=$(get_file_mtime "$path")
|
||||
local current_time=$(date +%s)
|
||||
local age_seconds=$((current_time - mod_time))
|
||||
local age_in_days=$((age_seconds / 86400))
|
||||
|
||||
@@ -40,7 +40,7 @@ clean_deep_system() {
|
||||
|
||||
# Skip system-protected files (restricted flag)
|
||||
local item_flags
|
||||
item_flags=$(command stat -f%Sf "$item" 2> /dev/null || echo "")
|
||||
item_flags=$($STAT_BSD -f%Sf "$item" 2> /dev/null || echo "")
|
||||
if [[ "$item_flags" == *"restricted"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user