1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 15:39:42 +00:00

fix: use BSD stat explicitly to avoid GNU coreutils conflict (#160)

This commit is contained in:
Nathan Broadbent
2025-12-26 15:43:18 +13:00
committed by GitHub
parent b09b771dfe
commit f838e9517d
4 changed files with 5 additions and 5 deletions

View File

@@ -210,9 +210,9 @@ is_recently_modified() {
return 1 return 1
fi fi
# Check modification time (macOS compatible) # Get modification time using base.sh helper (handles GNU vs BSD stat)
local mod_time 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 current_time=$(date +%s)
local age_seconds=$((current_time - mod_time)) local age_seconds=$((current_time - mod_time))
local age_in_days=$((age_seconds / 86400)) local age_in_days=$((age_seconds / 86400))

View File

@@ -40,7 +40,7 @@ clean_deep_system() {
# Skip system-protected files (restricted flag) # Skip system-protected files (restricted flag)
local item_flags 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 if [[ "$item_flags" == *"restricted"* ]]; then
continue continue
fi fi

View File

@@ -44,7 +44,7 @@ echo ""
echo "✓ Build complete!" echo "✓ Build complete!"
echo "" echo ""
file bin/analyze-go file bin/analyze-go
size_bytes=$(stat -f%z bin/analyze-go 2> /dev/null || echo 0) size_bytes=$(/usr/bin/stat -f%z bin/analyze-go 2> /dev/null || echo 0)
size_mb=$((size_bytes / 1024 / 1024)) size_mb=$((size_bytes / 1024 / 1024))
printf "Size: %d MB (%d bytes)\n" "$size_mb" "$size_bytes" printf "Size: %d MB (%d bytes)\n" "$size_mb" "$size_bytes"
echo "" echo ""

View File

@@ -37,7 +37,7 @@ echo ""
echo "✓ Build complete!" echo "✓ Build complete!"
echo "" echo ""
file bin/status-go file bin/status-go
size_bytes=$(stat -f%z bin/status-go 2> /dev/null || echo 0) size_bytes=$(/usr/bin/stat -f%z bin/status-go 2> /dev/null || echo 0)
size_mb=$((size_bytes / 1024 / 1024)) size_mb=$((size_bytes / 1024 / 1024))
printf "Size: %d MB (%d bytes)\n" "$size_mb" "$size_bytes" printf "Size: %d MB (%d bytes)\n" "$size_mb" "$size_bytes"
echo "" echo ""