13 lines
310 B
Bash
Executable File
13 lines
310 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
NOTESDIR="${NOTESDIR:-$HOME/Notes}"
|
|
NOTENAME="${1:-yearly}"
|
|
DATEDIR="$NOTESDIR/$(date +%Y)"
|
|
mkdir -p "$DATEDIR"
|
|
NOTEPATH="$DATEDIR/$NOTENAME"
|
|
echo "$NOTEPATH"
|
|
if ! [ -f "$NOTEPATH" ]; then
|
|
printf "$NOTENAME for $(date +%Y)\n---\n\n" > "$NOTEPATH"
|
|
fi
|
|
$EDITOR "$NOTEPATH"
|