nnote/mnote

13 lines
317 B
Plaintext
Raw Normal View History

2024-08-29 16:25:23 +00:00
#!/usr/bin/env bash
set -euo pipefail
NOTESDIR="${NOTESDIR:-$HOME/Notes}"
NOTENAME="${1:-monthly}"
DATEDIR="$NOTESDIR/$(date +%Y/%m)"
mkdir -p "$DATEDIR"
NOTEPATH="$DATEDIR/$NOTENAME"
echo "$NOTEPATH"
if ! [ -f "$NOTEPATH" ]; then
printf "$NOTENAME for $(date +%Y/%m)\n---\n\n" > "$NOTEPATH"
fi
$EDITOR "$NOTEPATH"