Skip to content

Instantly share code, notes, and snippets.

@sguzman
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save sguzman/25309a344cc9f89a6070 to your computer and use it in GitHub Desktop.

Select an option

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
# 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
}
@sguzman
Copy link
Copy Markdown
Author

sguzman commented Mar 19, 2015

Wow... the first one was pretty sloppy. Fixed it

@sguzman
Copy link
Copy Markdown
Author

sguzman commented Mar 19, 2015

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