Created
February 7, 2015 18:16
-
-
Save Tharre/706b0d8c3567c1f5346a to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash -e | |
# requires: jshon, perl, curl | |
input="input.json.tmp" | |
cleanup() { | |
rm -f $input | |
} | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 <user/repo>" >&2 | |
exit 1 | |
fi | |
trap cleanup EXIT | |
curl "https://api.github.com/repos/$1/issues" > $input | |
let count=$(jshon -l < $input)-1 | |
for i in $(seq 0 $count); | |
do | |
printf "%s (#%d)%n\n" "$(jshon -e "$i" -e title -u < $input)" "$(jshon -e "$i" -e number -u < $input)" n | |
perl -e "print '='x$n" | |
printf "\n\n" | |
jshon -e "$i" -e body -u < $input | |
printf "LABELS: " | |
jshon -e "$i" -e labels -a -e name -u < $input | paste -s -d" " | |
printf "\n\n" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment