diff options
Diffstat (limited to 'tools/swap-protocol.bash')
-rwxr-xr-x | tools/swap-protocol.bash | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/swap-protocol.bash b/tools/swap-protocol.bash index 00b6b4e..b7f4db2 100755 --- a/tools/swap-protocol.bash +++ b/tools/swap-protocol.bash | |||
@@ -13,9 +13,11 @@ git remote -v \ | |||
13 | 13 | ||
14 | if [[ $url =~ git@.*github.com ]]; then | 14 | if [[ $url =~ git@.*github.com ]]; then |
15 | target=${target:-https} | 15 | target=${target:-https} |
16 | # git@ -> https:// | ||
16 | [[ $target == https ]] && sed -E 's#^git@(.+):(.+)$#https://\1/\2#' <<<$url | xargs git remote set-url $extra $remote | 17 | [[ $target == https ]] && sed -E 's#^git@(.+):(.+)$#https://\1/\2#' <<<$url | xargs git remote set-url $extra $remote |
17 | elif [[ $url =~ https://.*github.com ]]; then | 18 | elif [[ $url =~ https://.*github.com ]]; then |
18 | target=${target:-git} | 19 | target=${target:-git} |
20 | # https:// -> git@ | ||
19 | [[ $target == git ]] && sed -E 's#^https://([^/]+)/(.+)$#git@\1:\2#' <<<$url | xargs git remote set-url $extra $remote | 21 | [[ $target == git ]] && sed -E 's#^https://([^/]+)/(.+)$#git@\1:\2#' <<<$url | xargs git remote set-url $extra $remote |
20 | fi | 22 | fi |
21 | done | 23 | done |