From 87acbe3874bd852c50115ff5deb9e0e7e9e0924d Mon Sep 17 00:00:00 2001 From: typebrook Date: Tue, 28 Apr 2020 11:20:01 +0800 Subject: update --- tools/swap-protocol.sh | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100755 tools/swap-protocol.sh (limited to 'tools/swap-protocol.sh') diff --git a/tools/swap-protocol.sh b/tools/swap-protocol.sh deleted file mode 100755 index 03594f8..0000000 --- a/tools/swap-protocol.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/env bash - -target='' -extra='' - -git remote -v \ -| while read remote url etc; do - [[ $etc =~ push ]] && extra='--push' - if [[ -z $target || $target == https ]] && [[ $url =~ git@.*github.com ]]; then - target=${target:-https} - sed -E 's#git@(.+):(.+)#https://\1/\2#' <<<$url | xargs git remote set-url $extra $remote - elif [[ -z $target || $target == git ]] && [[ $url =~ https://.*github.com ]]; then - target=${target:-git} - sed -E 's#https://([^/]+)/(.+)#git@\1:\2#' <<<$url | xargs git remote set-url $extra $remote - fi -done -- cgit v1.2.3-70-g09d2