17 lines
567 B
Bash
Executable File
17 lines
567 B
Bash
Executable File
#!/bin/sh
|
|
p=$PWD
|
|
cd $HOME/daten/Dropbox/dokumente/notes
|
|
loc=$1
|
|
case $1 in
|
|
log|life) shift; file=journal/${1:-general}.txt; date +%F >>$file;;
|
|
idea) shift; file=ideas/${1:-README}.md;;
|
|
box) shift; file=box/$1.md;;
|
|
write) shift; file=writings/$1.md;;
|
|
msg) shift; file=archive/messages/$1.md;;
|
|
*) file=${1:-README}.md;;
|
|
esac
|
|
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
|
|
cd $p
|