init note script
This commit is contained in:
17
note.sh
Executable file
17
note.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
readonly NOTES_INBOX="/home/jonathan/notes/+"
|
||||
readonly TEMPLATE="/home/jonathan/notes/Atlas/Utilities/Templates/new_note_template.md"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
FILENAME="$(date +%Y%m%d-%H%M%S).md"
|
||||
else
|
||||
FILENAME="${1}.md"
|
||||
fi
|
||||
|
||||
cp -pr ${TEMPLATE} ${NOTES_INBOX}/${FILENAME}
|
||||
chmod 600 ${NOTES_INBOX}/${FILENAME}
|
||||
DATE=$(date +%Y-%m-%d)
|
||||
sed -i "s/created:.*/created: ${DATE}/g" ${NOTES_INBOX}/${FILENAME}
|
||||
cd ${NOTES_INBOX}
|
||||
nvim -c "LivePreview start" ${FILENAME}
|
||||
Reference in New Issue
Block a user