diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-08-15 12:19:29 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-08-15 12:19:29 +0200 |
commit | b6484958979b0bb6398dc95b72f233bea20fe1b4 (patch) | |
tree | 828c54ffdc73ad2970c53f3d4200c2cdbfc9b75f /bin/extra/note | |
parent | 86c5ff5335a1adaf721778bdfcb79ff06726e71f (diff) |
checkpoint
Diffstat (limited to 'bin/extra/note')
-rwxr-xr-x | bin/extra/note | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/extra/note b/bin/extra/note new file mode 100755 index 0000000..82ae5e0 --- /dev/null +++ b/bin/extra/note @@ -0,0 +1,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 |