Advertisement
Guest User

Untitled

a guest
Dec 27th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.94 KB | None | 0 0
  1. #!/bin/sh
  2. echo Migrating Git projects
  3. for i in */.git; do
  4.     f=${i%/*}
  5.     cd $f
  6.         url=$(git remote get-url origin)
  7.         if [[ "$url" == *"git.wowace.com"* ]] || [[ "$url" == *"git.curseforge.com"* ]] || [[ "$url" == *"git.curseforge.net"* ]] ; then
  8.             url=$(echo $url | sed 's/.*git\.\(wowace\|curseforge\)\.\(com\|net\)[:/]wow\/\([^/]*\)\/.*/https:\/\/repos.\1.com\/wow\/\3/')
  9.             echo "Migrating $f to new repo url: $url"
  10.             git remote set-url origin $url
  11.         fi
  12.     cd ..
  13. done
  14. echo
  15. echo Migrating SVN projects
  16. for i in */.svn; do
  17.     f=${i%/*}
  18.     cd $f
  19.         url=$(svn info --show-item repos-root-url)
  20.         if [[ "$url" == *"svn.wowace.com"* ]] || [[ "$url" == *"svn.curseforge.com"* ]] || [[ "$url" == *"svn.curseforge.net"* ]] ; then
  21.             newurl=$(echo $url | sed 's/.*svn\.\(wowace\|curseforge\)\.\(com\|net\)\/wow\/\([^/]*\)\/.*/https:\/\/repos.\1.com\/wow\/\3/')
  22.             echo "Migrating $f to new repo url: $newurl"
  23.             svn relocate $url $newurl
  24.         fi
  25.     cd ..
  26. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement