Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Immediately wuphf for messages in the past
Browse files Browse the repository at this point in the history
  • Loading branch information
frioux committed Jun 16, 2019
1 parent 7691c65 commit 8e77db6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/enqueue-at
Expand Up @@ -5,10 +5,15 @@ perl -e 'exit 1 unless scalar grep m/^CREATE/, @ARGV' "$@" || exit


cd ~/Dropbox/notes/.alerts cd ~/Dropbox/notes/.alerts


for file in $(ls); do for file in *; do
ts="$(echo "$file" | cut -f1 -d_)" ts="$(echo "$file" | cut -f1 -d_)"
contents=$(cat "$file") contents=$(cat "$file")


echo "wuphf $contents" | at $(date -d "$ts" '+%H:%M %Y-%m-%d') # if the ts is before now
if perl -e'exit 1 if shift gt shift' "$ts" "$(date -Iseconds)"; then
wuphf "$contents"
else
echo "wuphf $contents" | at "$(date -d "$ts" '+%H:%M %Y-%m-%d')"
fi
rm "$file" rm "$file"
done done

0 comments on commit 8e77db6

Please sign in to comment.