Skip to content
Permalink
Browse files

Immediately wuphf for messages in the past

  • Loading branch information...
frioux committed Jun 16, 2019
1 parent 7691c65 commit 8e77db667eb93c5ca56e7ce7c005b81d52f72374
Showing with 7 additions and 2 deletions.
  1. +7 −2 bin/enqueue-at
@@ -5,10 +5,15 @@ perl -e 'exit 1 unless scalar grep m/^CREATE/, @ARGV' "$@" || exit

cd ~/Dropbox/notes/.alerts

for file in $(ls); do
for file in *; do
ts="$(echo "$file" | cut -f1 -d_)"
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"
done

0 comments on commit 8e77db6

Please sign in to comment.
You can’t perform that action at this time.