journal.sh
This commit is contained in:
parent
c5c5fb6f8a
commit
fbed644944
11
journal.sh
11
journal.sh
|
@ -14,6 +14,9 @@
|
|||
# journal edit
|
||||
|
||||
|
||||
#set repopath
|
||||
repopath="/home/david/docs"
|
||||
|
||||
#check if output file is given as first option
|
||||
if [ -z $1 ]; then
|
||||
outputfile=journal.txt
|
||||
|
@ -30,16 +33,22 @@ else
|
|||
elif [ $2 = "edit" ]; then
|
||||
vim $outputfile
|
||||
exit $?
|
||||
elif [ $2 = "sync" ]; then
|
||||
cd $repopath
|
||||
git add *
|
||||
git commit -am "changes by $HOSTNAME. syncing git repo."
|
||||
git push
|
||||
exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
#generating timestamp
|
||||
timestamp=$(date '+%d.%m.%Y %H:%M')
|
||||
|
||||
#read journal entry from stdin
|
||||
echo "enter oneliner into journal:"; read input
|
||||
|
||||
|
||||
#writing to outputfile
|
||||
echo "**** $timestamp ****" >> $outputfile
|
||||
echo $input >> $outputfile
|
||||
|
|
Loading…
Reference in New Issue