Skip to content

Instantly share code, notes, and snippets.

@aramboyajyan
Created August 19, 2020 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aramboyajyan/ad816479bd7e3ce4c561f02ac5790bf8 to your computer and use it in GitHub Desktop.
Save aramboyajyan/ad816479bd7e3ce4c561f02ac5790bf8 to your computer and use it in GitHub Desktop.
# Create a new note.
new_daily_note() {
cd ~/Documents/DailyNotes
currentDate=$(date '+%Y-%m-%d')
currentTime=$(date '+%H:%M')
fileName="${currentDate}.todo"
if [ -f "$fileName" ]; then
echo "Daily note file ($fileName) already exists."
else
cp _new.todo $fileName
touch $fileName
sed -i "" "s/{date}/${currentDate}/g" $fileName
sed -i "" "s/{time}/${currentTime}/g" $fileName
fi
sublime $fileName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment