Created
March 5, 2015 19:25
-
-
Save wbsch/ded3ae2a56cdd13dbb9f to your computer and use it in GitHub Desktop.
Example for an on-add hook that sets the project of newly added tasks to the current directory's name by default.
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 python | |
import json | |
import os | |
import sys | |
t = json.loads(sys.stdin.readline()) | |
if not 'project' in t: | |
t['project'] = os.path.basename(os.getcwd()) | |
print(json.dumps(t)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment