Skip to content

Commit 8b11d35

Browse files
committed
fixed forking for non-github repositories
1 parent 52069fb commit 8b11d35

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

docs/replication/create-forks-on-github.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,16 @@ while IFS= read -d '' -r repository
5454
do
5555
echo
5656
run cd "$repository"
57-
run gh repo fork --remote
58-
run git push -f origin
57+
url="$(git remote get-url origin)"
58+
if [[ "$url" ~= github.com ]]
59+
then
60+
echo "$repository is a github repo"
61+
run gh repo fork --remote
62+
run git push -f origin
63+
else
64+
echo "$repository is not a github repo"
65+
run gh repo create "$repository" -d "Fork of $url" --push --public --source .
66+
fi
5967
done
6068

6169
if [ "$was_logged_in" = "1" ]

0 commit comments

Comments
 (0)