Hacker News new | ask | show | jobs
by samuell 3128 days ago
My "bash function" adds just a few more lines, so as to git add/commit/push after closing the editor, and adding a good title by default:

----

journalfile=$(date --utc +%Y%m%d-%u.md);

if [[ ! -f $journalfile ]]; then

echo "# "$(date "+%A, %e %B, %Y") >> $journalfile;

git add $journalfile;

else

echo "File already exists: $journalfile";

fi;

vim $journalfile;

git commit -m "Changes in journal file $journalfile" $journalfile;

git push origin master;

----

Source: https://github.com/samuell/mdnote/blob/master/editnewjournal...