#!/bin/bash # # Worklog wrapper # # Alternatives to current worklog backend: # # https://github.com/distilledhype/node-worklog # https://github.com/snaptortoise/worklog # https://github.com/tormaroe/worklog # https://github.com/winged/worklog # https://github.com/yaccz/worklog BASE="$HOME/file" CODEBASE="$HOME/code" GROUP="$1" ACTION="$2" BASENAME="`basename $0`" EDITOR=${EDITOR:=vi} # Setup a new worklog configuration function timelog_setup { cat > $BASE/$GROUP/worklog/projects < [edit]" exit 1 } # Run function timelog_run { if [ -d "$CODEBASE/$GROUP" ] && [ ! -d "$BASE/$GROUP" ]; then BASE="$CODEBASE" fi mkdir -p $BASE/$GROUP/worklog if [ ! -e "$BASE/$GROUP/worklog/projects" ]; then timelog_setup elif [ "$ACTION" == "edit" ]; then $EDITOR $BASE/$GROUP/worklog/projects else ( cd $BASE/$GROUP/worklog && worklog ) fi } # Main if [ ! -z "$GROUP" ]; then timelog_run else timelog_menu fi