diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2024-02-26 19:57:06 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-03-01 00:51:48 +0100 |
commit | 168cfd0afc78c5f2818ee5c297e6bdb0f9ffda0a (patch) | |
tree | 3b21a20c51c2f13f97806ea5f54cfe87ac7a57d2 /add-networked-repos.sh | |
parent | 2a88ef71ca39471c14c2879d4c1b273064841707 (diff) | |
download | hlupak-168cfd0afc78c5f2818ee5c297e6bdb0f9ffda0a.tar.gz |
fix(add-networked-repos): Fix typos and persist failure.
Diffstat (limited to 'add-networked-repos.sh')
-rwxr-xr-x | add-networked-repos.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/add-networked-repos.sh b/add-networked-repos.sh index 7a7df48..fa7697f 100755 --- a/add-networked-repos.sh +++ b/add-networked-repos.sh @@ -2,8 +2,8 @@ set -eux set -o noglob -API_URL="https://api.github.com/repos/" -REPO_URL="https://github.com/%s/%s" +API_URL="https://api.github.com/repos" +REPO_URL="https://github.com" if [ $# -ne 1 ] ; then echo "The only parameter of the script is user/name of the repo" @@ -18,10 +18,10 @@ get_forks() { repo_url="$API_URL/$fname/forks" repos="$(curl -s "$repo_url" | jq -r '.[]|.full_name')" for full_name in $repos ; do - IFS='/' read -a -r names <<< "${full_name}" + IFS='/' read -r -a names <<< "${full_name}" l_user="$(echo "${names[0]}"|tr '[:upper:]' '[:lower:]')" git remote add "${l_user}" "${REPO_URL}/${full_name}" - git fetch "${l_user}" + git fetch "${l_user}" || continue get_forks "${full_name}" done } |