summaryrefslogtreecommitdiff
path: root/bin/extra/note
blob: 82ae5e01c5068fb8dd80363ffd77d7b3e2c7e8fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# Write a note

notes="$HOME/notes"
if [ ! -d "$notes" ]; then
	>&2 printf 'Create the notes directory.\n'
	exit 1
fi

if [ "$1" ]; then
	name="$1"
else
	>&2 printf 'name> '
	name="$(head -n 1)"
fi
[ "$name" ] || exit 1

$EDITOR $HOME/notes/"$name".md