From 4e840780a1d494640b7060f2bf7cc261dda343a2 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Wed, 22 May 2024 11:14:17 -0500 Subject: Update capture script --- local/bin/capture | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'local') diff --git a/local/bin/capture b/local/bin/capture index cac405a..f8824cd 100755 --- a/local/bin/capture +++ b/local/bin/capture @@ -1,13 +1,16 @@ #!/bin/sh -JRNL="$STITCH_DIRECTORY/$(date +'%y-%m-%d.%H:%M.%S').org" -echo '* ' > /tmp/capture -kak /tmp/capture +1:3 -e "execute-keys i" -if grep -q '^\*\s*$' /tmp/capture +DATE=$(date +'%y-%m-%d.%H:%M.%S') +CAPTURE_FILE="/tmp/capture-$DATE" +echo $DATE +JRNL="$STITCH_DIRECTORY/$DATE.org" +echo '* ' > $CAPTURE_FILE +kak $CAPTURE_FILE +1:3 -e "execute-keys i" +if grep -q '^\*\s*$' $CAPTURE_FILE then echo "Empty capture; ignoring" else echo "Storing capture in $JRNL" - cat /tmp/capture > $JRNL + cat $CAPTURE_FILE > $JRNL fi -- cgit v1.2.3