diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2021-05-08 10:09:16 +0100 |
|---|---|---|
| committer | Paul Buetow <git@mx.buetow.org> | 2021-05-21 05:11:04 +0100 |
| commit | 233af588b4fd66ebc0ebc3d9be6b3a2605f14c8c (patch) | |
| tree | 4d7dcd157c6f35f305790903dbe06a690ff65d8d | |
| parent | d64a1905c1700d852b20ce96179207a53e74bbe1 (diff) | |
use gdate
| -rwxr-xr-x | buetow.org.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/buetow.org.sh b/buetow.org.sh index 2fe68d76..ce35b7e3 100755 --- a/buetow.org.sh +++ b/buetow.org.sh @@ -3,6 +3,11 @@ declare -r ARG=$1; shift source buetow.org.conf +declare DATE=date +if where gdate &>/dev/null; then + DATE=gdate +fi + ## Test module assert::equals () { @@ -80,7 +85,7 @@ atomfeed::meta () { local summary=$(sed -n '/^[A-Z]/ { p; q; }' "$gmi_file_path" | tr '"' "'") # Extract the date from the file name. local filename_date=$(basename $gmi_file_path | cut -d- -f1,2,3) - local date=$(date --iso-8601=seconds --date "$filename_date $(date +%H:%M:%S)") + local date=$($DATE --iso-8601=seconds --date "$filename_date $(date +%H:%M:%S)") cat <<META | tee "$meta_file" local meta_date="$date" @@ -109,7 +114,7 @@ atomfeed::content () { atomfeed::generate () { local -r gemfeed_dir="$CONTENT_DIR/gemtext/gemfeed" local -r atom_file="$gemfeed_dir/atom.xml" - local -r now=$(date --iso-8601=seconds) + local -r now=$($DATE --iso-8601=seconds) cat <<ATOMHEADER > "$atom_file.tmp" <?xml version="1.0" encoding="utf-8"?> |
