Created
January 12, 2016 10:43
-
-
Save awesomebytes/387ff2eaf845461c92b2 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 | |
| path=$1 | |
| if [ ! $# -eq 1 ]; then | |
| echo "Usage is $0 path_to_workspace_src" | |
| exit -1 | |
| fi | |
| cd $path | |
| rosinstall_file=$PWD/.rosinstall | |
| rm $rosinstall_file | |
| for d in $(ls */ -d); do | |
| pushd $d | |
| name=`basename $PWD` | |
| if [ -d .git ]; then | |
| url=`git remote -v | grep origin | grep fetch| cut -f2 | cut -d' ' -f1` | |
| branch=`git br | cut -d' ' -f2` | |
| echo "- git: {local-name: $name, uri: '$url', version: '$branch'}" >> $rosinstall_file | |
| fi | |
| popd | |
| done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment