Skip to content

Instantly share code, notes, and snippets.

@doctorallen
Last active August 29, 2015 14:13
Show Gist options
  • Save doctorallen/675984b66c52412f23ed to your computer and use it in GitHub Desktop.
Save doctorallen/675984b66c52412f23ed to your computer and use it in GitHub Desktop.
Run A Time Report
#!/usr/bin/env bash
# You will want to also add the git today command: https://github.com/doctorallen/dotfiles/blob/master/.gitconfig#L49
root=$1
if [ -n "$root"]
then
echo "Error: please define the root directory location for your report."
read root
fi
lastchar=${#root}-1
if [ "${lastchar}" != "/" ]; then
echo "Warning: You did not add a trailing slash, it was added automatically."
root="${root}/"
fi
cd ${root}
echo "Time Tracking Report for $(date +%m-%d-%Y)"
for dir in ${root}*/
do
cd ${dir}
if [ -d ".git" ]; then
if [[ -n $(git today) ]]; then
project=${dir%*/}
echo ${project##*/}
git today
fi
fi
done
@Rican7
Copy link

Rican7 commented Jan 19, 2015

Awesome! Thanks Dave.
It looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment