mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 14:12:41 +00:00
Added zet command
This commit is contained in:
18
scripts/scripts/zet
Executable file
18
scripts/scripts/zet
Executable 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}"
|
||||
Reference in New Issue
Block a user