gh-notify-move/get-my-repos.sh
Yann Esposito (Yogsototh) f14e64b82d
initial commit
2018-06-06 16:19:08 +02:00

9 lines
285 B
Bash
Executable file

#!/bin/bash
GHUSER="${1:-$USER}"
NBPAGES="${2:-1}"
for page in $(seq 1 $NBPAGES); do
echo "Retrieving page $page" >&2
curl "https://api.github.com/users/$GHUSER/repos?page=${page}&per_page=100" | grep '"ssh_url":' | perl -pe 's#^\s*"ssh_url": "([^"]*)".*$#$1#'
done > repos-urls