Created
December 27, 2020 03:28
-
-
Save dylan-k/c5dd8381eafaf8a785a6956411f93341 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# daylog opener | |
# run this at startup to have notes ready | |
FILE=~/Journal/_posts/$(date +%Y)-$(date +%m)_DAYLOG.txt | |
MONTH=$(date '+%Y-%m') | |
DATE=$(date '+%a %Y-%m-%d %l:%M %P') | |
echo "$FILE" | |
if test -f "$FILE"; then | |
echo "$FILE exists." | |
sed -i "6i $DATE" $FILE | |
sed -i '7i --------------------------------------------------------------------------------\n\n\n' $FILE | |
code -g $FILE:9 | |
else | |
echo "$FILE does not exist" | |
echo "---" >> $FILE | |
echo "title: daylog" $(date +%Y)-$(date +%m) >> $FILE | |
echo "date: " $(date +%Y)-$(date +%m) >> $FILE | |
echo "---" >> $FILE | |
echo >> $FILE | |
echo >> $FILE | |
echo "$DATE" >> $FILE | |
echo "--------------------------------------------------------------------------------" >> $FILE | |
echo >> $FILE | |
code -g $FILE:10 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment