You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotfiles/bin/timetracker/timetracker.sh

15 lines
303 B
Bash

#!/bin/bash
timestamp=$(date +%m-%dT%H:%M);
timesheet="$HOME/.dotfiles/bin/timetracker/timesheet.log"
if [[ ! -e "$timesheet" ]] ; then
touch "$timesheet"
fi
if [[ $1 == "-i" ]] ; then
echo "I $timestamp" >> "$timesheet"
elif [[ $1 = "-o" ]] ; then
echo "O $timestamp" >> "$timesheet"
fi