aboutsummaryrefslogtreecommitdiffstats
path: root/_tj
diff options
context:
space:
mode:
authorMatthew Lemon <chaffinach+git@protonmail.ch>2022-01-14 11:11:18 +0000
committerMatthew Lemon <chaffinach+git@protonmail.ch>2022-01-14 11:11:18 +0000
commit53d7717f9a9fd45706ffcb4892b9edd46f05afe4 (patch)
tree55bef6948542ce98953f4bdcf9c5cf02da3463d1 /_tj
parent715ee043aff6a0d1367ac3dac0fd7daa35976248 (diff)
now includes tasklog in the template
Diffstat (limited to '')
-rwxr-xr-x_tj15
1 files changed, 9 insertions, 6 deletions
diff --git a/_tj b/_tj
index 469c4cb..fddb4c6 100755
--- a/_tj
+++ b/_tj
@@ -6,19 +6,22 @@ TODAY_JOURNAL=~/Notes/journal/$(date +\%Y-\%m-\%d).md
# Test whether it already exisits or not
if [[ -a $TODAY_JOURNAL ]]
then
- while read line
+ while read -r line
do
JLINE="- $(date +'%H:%M'): $line"
- echo $JLINE >> "$TODAY_JOURNAL"
+ echo "$JLINE" >> "$TODAY_JOURNAL"
done < "${1:-/dev/stdin}"
else
- touch $TODAY_JOURNAL
+ touch "$TODAY_JOURNAL"
header_date="$(date +'%A %d %b %Y')"
- echo -e "# $header_date\n" >> $TODAY_JOURNAL
- while read line
+ { echo -e "# $header_date\n"
+ echo -e "## Tasklog\n"
+ echo -e "## Journal\n"
+ } >> "$TODAY_JOURNAL"
+ while read -r line
do
JLINE="- $(date +'%H:%M'): $line"
- echo $JLINE >> "$TODAY_JOURNAL"
+ echo "$JLINE" >> "$TODAY_JOURNAL"
done < "${1:-/dev/stdin}"
fi