Created
December 9, 2015 18:43
-
-
Save coffeemancy/33ea07bc1d7c68e5f794 to your computer and use it in GitHub Desktop.
idonethis bash functions
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
## IDoneThis | |
function _set_idonethis_token { | |
local token=$(pass datarobot/idonethis | grep Token | cut -d ' ' -f 2) | |
export IDONETHIS_TOKEN=${token} | |
} | |
function idid { | |
_set_idonethis_token | |
local team='datarobot-work-notes' | |
idonethis --token ${IDONETHIS_TOKEN} --team ${team} "$@" | |
} | |
function whatidid { | |
_set_idonethis_token | |
local done_date=${1:-today} | |
local owner=carltonstedman | |
local team=datarobot-work-notes | |
local url="https://idonethis.com/api/v0.1/dones/" | |
curl –s -H "Authorization: Token ${IDONETHIS_TOKEN}" \ | |
"${url}?owner=${owner}&team=${team}&done_date=${done_date}" \ | |
2>/dev/null | jq '.results[].raw_text' -M \ | |
| sed -e 's/^\"\(.*\)\"$/\1/g' \ | |
| grep -e '^\[x\]' --color=no | |
} | |
function todo { | |
_set_idonethis_token | |
local owner=carltonstedman | |
local team=datarobot-work-notes | |
local url="https://idonethis.com/api/v0.1/dones/" | |
curl –s -H "Authorization: Token ${IDONETHIS_TOKEN}" \ | |
"${url}?owner=${owner}&team=${team}"\ | |
2>/dev/null | jq '.results[].raw_text' -M \ | |
| sed -e 's/^\"\(.*\)\"$/\1/g' \ | |
| grep -e '^\[\]' --color=no | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment