From 3a66d6dbce7f50728751eae3da8ffe58386ee68e Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Tue, 14 Oct 2025 16:57:48 -0400 Subject: Revert "clone-all-github->sync-github" This reverts commit 635e0ce52d634445c3ae4e783b91363b478722df. --- clone-all-github | 29 +++++++++++++++++++++++++++++ help | 2 +- sync-github | 29 ----------------------------- 3 files changed, 30 insertions(+), 30 deletions(-) create mode 100755 clone-all-github delete mode 100755 sync-github diff --git a/clone-all-github b/clone-all-github new file mode 100755 index 0000000..739f8db --- /dev/null +++ b/clone-all-github @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +USER=compromyse +REPOS=$(curl https://api.github.com/users/$USER/repos 2>/dev/null) + +for i in $(seq 0 1 $(( $(echo $REPOS | jq length) - 1 ))); do + name=$(echo $REPOS | jq -r .[$i].name) + description=$(echo $REPOS | jq -r .[$i].description) + + repo=$name.git + + if [ ! -d $HOME/$repo ]; then + + git clone --bare https://github.com/$USER/$repo $HOME/$repo + + pushd $HOME/$repo > /dev/null + + for remote in $(git remote show); do + git remote remove $remote + git remote add github git@github.com:$USER/$repo + git fetch github + done + + echo "$description" > description + + popd > /dev/null + + fi +done diff --git a/help b/help index 97c3bcc..8ad82f1 100755 --- a/help +++ b/help @@ -8,6 +8,6 @@ init desc rm bash -sync-github +clone-all-github update-timestamps """ diff --git a/sync-github b/sync-github deleted file mode 100755 index 739f8db..0000000 --- a/sync-github +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -USER=compromyse -REPOS=$(curl https://api.github.com/users/$USER/repos 2>/dev/null) - -for i in $(seq 0 1 $(( $(echo $REPOS | jq length) - 1 ))); do - name=$(echo $REPOS | jq -r .[$i].name) - description=$(echo $REPOS | jq -r .[$i].description) - - repo=$name.git - - if [ ! -d $HOME/$repo ]; then - - git clone --bare https://github.com/$USER/$repo $HOME/$repo - - pushd $HOME/$repo > /dev/null - - for remote in $(git remote show); do - git remote remove $remote - git remote add github git@github.com:$USER/$repo - git fetch github - done - - echo "$description" > description - - popd > /dev/null - - fi -done -- cgit v1.2.3