From 4cd8bfd8ef4495f6d49dbc8ccd44bf6806fc4ae4 Mon Sep 17 00:00:00 2001 From: Seth House Date: Tue, 24 Mar 2015 00:21:57 -0400 Subject: [PATCH] Added function to retrieve organization teams --- octokit.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/octokit.sh b/octokit.sh index d74538e..12f2ab8 100755 --- a/octokit.sh +++ b/octokit.sh @@ -441,6 +441,29 @@ org_repos() { | _filter ".[] | \"${filter}\"" } +org_teams() { + # List teams + # + # Usage: + # org_teams org + # + # Positional arguments + # + local org=$1 + # Organization GitHub login or id. + # + # Keyword arguments + # + local filter='\(.name)\t\(.id)\t\(.permission)' + # A jq filter using string-interpolation syntax that is applied to each + # team in the return data. + + [ -n "$org" ] && shift || _err 'Org name required.' E_INVALID_ARGS + + request "/orgs/${org}/teams" \ + | _filter ".[] | \"${filter}\"" +} + create_repo() { # Create a repository for a user or organization #