Last active
August 29, 2015 14:17
-
-
Save sguzman/25309a344cc9f89a6070 to your computer and use it in GitHub Desktop.
Attempt to get taskwarrior to recognize project when inside a git repo dir
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
| # Taskwarrior simple checker for git repo | |
| # If it finds one, use the project dir as the project filter | |
| function t() { | |
| git show &> /dev/null | |
| retval=$? | |
| if [ $retval -eq "0" ]; then | |
| dir=$(git rev-parse --show-toplevel) | |
| project=$(basename $dir) | |
| task "$@" project:$project | |
| else | |
| task "$@" | |
| fi | |
| } |
Author
Author
Without dependency on env vars - all it does not is add a project filter now
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow... the first one was pretty sloppy. Fixed it