Last active
December 17, 2015 07:29
-
-
Save dfreedm/5572796 to your computer and use it in GitHub Desktop.
Rename toolkit -> polymer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| REPOS=( | |
| CustomElements | |
| HTMLImports | |
| MutationObservers | |
| PointerEvents | |
| PointerGestures | |
| ShadowDOM | |
| aux-elements | |
| labs | |
| mdv | |
| pantry | |
| platform | |
| projects | |
| toolkit | |
| toolkit-elements | |
| toolkit-ui | |
| toolkitchensink | |
| ) | |
| REGEX='s/\btoolkit\b/polymer/; s/\btoolkitchen\b/polymer-project/; s/\btoolkitchensink\b/polymer-all/;' | |
| rename() { | |
| REPO=$1 | |
| NEW=$2 | |
| pushd $1 | |
| git remote set-url origin $(git config --get remote.origin.url | perl -pl -E "s{$1}{$2}") | |
| popd | |
| mv $1 $2 | |
| } | |
| for REPO in ${REPOS[@]}; do | |
| if [ -d $REPO ]; then | |
| if [ $REPO = "aux-elements" ]; then | |
| rename $REPO "polymer-ui-elements" | |
| REPO="polymer-ui-elements" | |
| elif [ $REPO = "toolkitchensink" ]; then | |
| rename $REPO "polymer-all" | |
| REPO="polymer-all" | |
| elif [ $REPO = "toolkit" ]; then | |
| rename $REPO "polymer" | |
| REPO="polymer" | |
| elif [ $REPO = "toolkit-elements" ]; then | |
| rename $REPO "polymer-elements" | |
| REPO="polymer-elements" | |
| elif [ $REPO = "pantry" ]; then | |
| rename $REPO "more-elements" | |
| REPO="more-elements" | |
| fi | |
| pushd $REPO | |
| URL=$(git config --get remote.origin.url | perl -pl -E "$REGEX") | |
| git remote set-url origin "$URL" | |
| git pull | |
| git checkout master | |
| git submodule sync | |
| git submodule update --init --recursive | |
| popd | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment