Added zet command

This commit is contained in:
2022-01-05 16:59:04 -05:00
parent 8f4dbca52d
commit e5dae43c66

18
scripts/scripts/zet Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
# Creates a new `zet` inside the public `Zettlekasten` directory.
dirname="$(isosec)"
mkdir "$ZETDIR/$dirname"
dir="$ZETDIR/$dirname"
readme="$dir/README.md"
title="$*"
printf "# %s\n\n" "${title}" > "${readme}"
message="${title:-"Autocommit message"}"
cd "$dir"
git pull -q
git add -A "$dir"
git commit -m "$message"
git push
cd -
vi "${readme}"