Skip to content

Instantly share code, notes, and snippets.

@perlpunk
Created January 25, 2016 10:05
Show Gist options
  • Save perlpunk/cee0fb225b974a1a9052 to your computer and use it in GitHub Desktop.
Save perlpunk/cee0fb225b974a1a9052 to your computer and use it in GitHub Desktop.
git-hub-event-bug
#!/usr/bin/env bash
set -e
command:event-user() {
get-args owner:get-user
title="Events for '$owner':"
report-list \
"/users/$owner/events" \
"id created_at type repo/name payload/ref_type payload/ref payload/master_branch created_at payload/action"
}
format-entry:event-user () {
if "$raw_output"; then
out "$2"
else
local date="${3/T/ }"
date="${date/Z}"
local prefix
printf -v prefix "%2d) %s %s" "$1" "$2" "$date"
case $4 in
*)
printf -v output_line "$prefix %-14s %-12s %s %s %s %s %s %s" \
"$4" "${5/Event}" "$6" "$7" "$8" "$9" "${10}"
;;
esac
fi
}
# vim: set lisp:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment