Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- echo Migrating Git projects
- for i in */.git; do
- f=${i%/*}
- cd $f
- url=$(git remote get-url origin)
- if [[ "$url" == *"git.wowace.com"* ]] || [[ "$url" == *"git.curseforge.com"* ]] || [[ "$url" == *"git.curseforge.net"* ]] ; then
- url=$(echo $url | sed 's/.*git\.\(wowace\|curseforge\)\.\(com\|net\)[:/]wow\/\([^/]*\)\/.*/https:\/\/repos.\1.com\/wow\/\3/')
- echo "Migrating $f to new repo url: $url"
- git remote set-url origin $url
- fi
- cd ..
- done
- echo
- echo Migrating SVN projects
- for i in */.svn; do
- f=${i%/*}
- cd $f
- url=$(svn info --show-item repos-root-url)
- if [[ "$url" == *"svn.wowace.com"* ]] || [[ "$url" == *"svn.curseforge.com"* ]] || [[ "$url" == *"svn.curseforge.net"* ]] ; then
- newurl=$(echo $url | sed 's/.*svn\.\(wowace\|curseforge\)\.\(com\|net\)\/wow\/\([^/]*\)\/.*/https:\/\/repos.\1.com\/wow\/\3/')
- echo "Migrating $f to new repo url: $newurl"
- svn relocate $url $newurl
- fi
- cd ..
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement