Last active
August 29, 2015 14:13
-
-
Save doctorallen/675984b66c52412f23ed to your computer and use it in GitHub Desktop.
Run A Time Report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome! Thanks Dave.
It looks great!