Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!bin/bash
- # This script is for me creating my brain dumps that I usually do jumping right into it in vim.
- # I have a template file also defined that I can setup if I want.
- # This script also brings me back to the same context that I was in earlier
- set -ex
- cd ~/brain-dumps/
- # Ex. 2019-04-14
- DATE=`date +%Y-%m-%d`
- EXTENTION='.md'
- FILE_NAME="$DATE$EXTENTION"
- if test -f "$FILE_NAME"
- then
- echo "File exists. Opening existing for $DATE"
- else
- # Simple template
- echo "# Brain dump $DATE" >> $FILE_NAME
- fi
- vim $FILE_NAME
- git add $FILE_NAME
- git commit -m "Brain dump $FILE_NAME"
- git push
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement