2020-09-04 10:16:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
p=$PWD
|
|
|
|
cd $HOME/daten/Dropbox/dokumente/notes
|
2020-09-19 07:36:45 +00:00
|
|
|
loc=$1
|
2020-09-04 10:16:46 +00:00
|
|
|
case $1 in
|
2020-10-07 19:54:05 +00:00
|
|
|
log|jrnl) shift; file=journal/${1:-jrnl}.txt;; #date +%F >>$file;;
|
2020-09-19 07:36:45 +00:00
|
|
|
idea) shift; file=ideas/${1:-README}.md;;
|
|
|
|
box) shift; file=box/$1.md;;
|
2020-09-04 10:16:46 +00:00
|
|
|
write) shift; file=writings/$1.md;;
|
|
|
|
msg) shift; file=archive/messages/$1.md;;
|
|
|
|
*) file=${1:-README}.md;;
|
|
|
|
esac
|
2020-09-19 07:36:45 +00:00
|
|
|
comment=$(test -f $file && echo Update || echo Create)
|
|
|
|
test "$2" && echo "$2" >>$file || $EDITOR + $file
|
|
|
|
git add $file && git commit -m "$(test "$(dirname $file)" != "." && echo "${loc%%/*}: ")$comment $(basename $file)" && git push
|
2020-09-04 10:16:46 +00:00
|
|
|
cd $p
|