Skip to content

Instantly share code, notes, and snippets.

@andscoop
Created September 30, 2018 22:25
Show Gist options
  • Save andscoop/09c08f81d48c33d4b7145ec5f1344a65 to your computer and use it in GitHub Desktop.
Save andscoop/09c08f81d48c33d4b7145ec5f1344a65 to your computer and use it in GitHub Desktop.
Bash Track
###############################
### *B*ASH *T*RACK
## A series of commands leveraging git and file system to do time tracking, task management, note taking
# Path BASHTRACK repo
export BT_ROOT="/Users/andscoop/dev/kb-andscoop/notes"
# Convenience env for grouping daily files by month
export BT_TIMETRACK_PATH="$BT_ROOT/daily/$(date '+%m')"
# Convenience env for getting daily file
export BT_DAILY_FILE="$BT_TIMETRACK_PATH/$(date '+%Y-%m-%d'.md)"
## START | Mark beginning of the day
# create dir if not exist -> create daily file if not exist -> git add -> commit
alias bt-start="mkdir -p $BT_TIMETRACK_PATH && touch $BT_DAILY_FILE && (cd $BT_ROOT && git add . && git commit -m 'Start day')"
## END | Mark end of the day
# append '> End' to daily file -> git add -> commit -> push
alias bt-end="echo '> End' >> $BT_DAILY_FILE && (cd $BT_ROOT && git add . && git commit -m 'Stop day' && git push)"
## DONE | Mark task as complete
# git add -> commit
alias bt-done="(cd $BT_ROOT && git add . && git commit -m 'Task completed')"
## RESUME | Resume the day
# append '> Resume' to dailyfile -> git add -> commit
alias bt-resume="echo '> Resume' >> $BT_DAILY_FILE && (cd $BT_ROOT && git add . && git commit -m 'Resume day')"
###############################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment