diff --git a/github-orga-call.sh b/github-orga-call.sh new file mode 100755 index 0000000000000000000000000000000000000000..4de364c9d7ecad4974d45655295de7c4d9f1da18 --- /dev/null +++ b/github-orga-call.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -e +if [ "$DEBUG" = "1" ]; then + set -x +fi + +if [ "$1" = "" ]; then + cat >/dev/stderr << EOF + Usage: + $0 <organization name> + Example: + $0 octocat +EOF + exit 1 +fi +ORGA_SLUG="$1" + +if grep 'https://github.com/' <<< "$ORGA_SLUG"; then + ORGA_SLUG="$(sed -Ee 's/^https:\/\/github\.com\/([^/]+).*/\1/' <<< "$ORGA_SLUG")" +fi + +shift + +curl -s "https://api.github.com/orgs/${ORGA_SLUG}/repos?per_page=200" | jq -r '.[].clone_url' | xargs -L1 $@