Created
July 23, 2012 22:21
-
-
Save sheepmaster/3166612 to your computer and use it in GitHub Desktop.
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 | |
| if test -z "$1"; then | |
| case `uname -s` in | |
| "Linux") | |
| os=unix | |
| ;; | |
| "Darwin") | |
| os=mac | |
| ;; | |
| *) | |
| echo "You didn't specify an OS (mac, win, unix, or android), and I can't figure it out from 'uname -s'" 1>&2 | |
| exit 1 | |
| ;; | |
| esac | |
| else | |
| os=$1 | |
| fi | |
| git config target.os $os | |
| git checkout --force HEAD | |
| git config -f .gitmodules --get-regexp '.os$' "(all|$os)" | | |
| sed 's/^submodule\.\(.*\)\.os .*$/\1/' | | |
| while read submodule; do | |
| git config submodule.$submodule.update checkout | |
| (cd $submodule && git checkout --force HEAD) | |
| done | |
| git submodule init | |
| git submodule update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment