Created
October 15, 2013 07:46
-
-
Save garryyao/6987989 to your computer and use it in GitHub Desktop.
Shell script to issue git command for each troopjs sub module in bundle repo.
This file contains 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 | |
# Issue arbitary git command for each of the sub modules. | |
# E.g. git-bundle checkout feature/docs | |
# Check out the feature/docs branch for each of the sub module. | |
function print_header | |
{ | |
printf '%.0s-' {1..30} && echo | |
echo $1 | |
printf '%.0s-' {1..30} && echo | |
} | |
# Blobing pattern for directories, replace with whatever u like. | |
PATTERN="**/troopjs-*" | |
# Pass all params to git command. | |
COMMAND=$@ | |
for i in $PATTERN | |
do | |
print_header $i | |
git --git-dir=$i/.git --work-tree=$PWD/$i $COMMAND | |
printf '\n\n\n' | |
done | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For windows, i just build a work around for bundle checkout "Bower" linked troopjs repos.
Save the following script in "git-bundle.cmd" and put it to "troopjs" dir.
Please use command: "git-bundle.cmd checkout feature/docs" to checkout all doc branches.