Last active
October 22, 2015 06:16
-
-
Save pulecp/1524f66d5a8a26d98102 to your computer and use it in GitHub Desktop.
Add to submodules from another project with selection
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 | |
exec 3<submodules | |
while read -u 3 -r NAME;read -u 3 -r REPO | |
do | |
REPO_DIR=`echo $NAME|cut -d '"' -f2` | |
REPO_URL=`echo $REPO|cut -d '=' -f2` | |
[ -d $REPO_DIR ] && continue | |
while true; do | |
echo "repo_dir: $REPO_DIR $REPO_URL" | |
read -p "Do you wish to add this submodule? [y/n]" yn | |
case $yn in | |
[Yy]* ) | |
git submodule add $REPO_URL $REPO_DIR | |
break;; | |
[Nn]* ) | |
break;; | |
* ) | |
echo "Please answer yes or no.";; | |
esac | |
done | |
done |
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
[submodule "modules/nodejs"] | |
url = ssh://git@redmine.example.com:2223/puppetmaster/modules/nodejs.git | |
[submodule "modules/symfony"] | |
url = ssh://git@redmine.example.com:2223/puppetmaster/modules/inuits-puppet-symfony.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment