date.do (512B)
1 FALLBACKDATE=${FALLBACKDATE:-unknown} 2 LC_ALL=C 3 export LC_ALL 4 user=$(unalias ls >/dev/null 2>&1 || true; \ 5 command ls -ld . | awk '{print $3}') 6 e_user=$(id -un) 7 if [ -d .git ] && command -v git >/dev/null 2>&1; then 8 if [ "$e_user" = "$user" ]; then 9 git log --format=format:%cd \ 10 --date=format:"%B %d, %Y" -1 @ >$3 11 else 12 su "${user}" -c 'env LC_ALL=C git log --format=format:%cd \ 13 --date=format:"%B %d, %Y" -1 @' >$3 14 fi 15 echo >>$3 16 else 17 printf "%s\n" "$FALLBACKDATE" >$3 18 fi 19 redo-always 20 redo-stamp <$3