Running into a hard failure on macOS Sonoma 14.2 when the sync script tries to check file modification times.
The error is:
stat: illegal option -- c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file ...]
The issue is that stat -c '%Y' is a GNU coreutils thing. macOS ships with BSD stat, which uses stat -f '%m' for the same thing.
Quick fix would be something like:
if [[ "$OSTYPE" == "darwin"* ]]; then
mod_time=$(stat -f '%m' "$file")
else
mod_time=$(stat -c '%Y' "$file")
fi
Or just use date -r which works on both, though it's slower for batch operations.
I can submit a PR if you want — just wanted to flag it first since it completely blocks macOS usage right now.
Running into a hard failure on macOS Sonoma 14.2 when the sync script tries to check file modification times.
The error is:
The issue is that
stat -c '%Y'is a GNU coreutils thing. macOS ships with BSD stat, which usesstat -f '%m'for the same thing.Quick fix would be something like:
Or just use
date -rwhich works on both, though it's slower for batch operations.I can submit a PR if you want — just wanted to flag it first since it completely blocks macOS usage right now.