Created
August 19, 2020 07:26
-
-
Save aramboyajyan/ad816479bd7e3ce4c561f02ac5790bf8 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
# 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