summaryrefslogtreecommitdiff
path: root/local
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-22 11:14:17 -0500
committerMarc Coquand <marc@mccd.space>2024-05-22 11:14:17 -0500
commit4e840780a1d494640b7060f2bf7cc261dda343a2 (patch)
tree7a1a207af5faf1c5e243a000e5e106a78681a6c8 /local
parent9dcb8b99bed3e7cd4c6f5782955b3043a5103d8b (diff)
downloadrcm-4e840780a1d494640b7060f2bf7cc261dda343a2.tar.gz
rcm-4e840780a1d494640b7060f2bf7cc261dda343a2.tar.bz2
rcm-4e840780a1d494640b7060f2bf7cc261dda343a2.zip
Update capture script
Diffstat (limited to 'local')
-rwxr-xr-xlocal/bin/capture13
1 files changed, 8 insertions, 5 deletions
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