Skip to content

Instantly share code, notes, and snippets.

@awesomebytes
Created January 12, 2016 10:43
Show Gist options
  • Select an option

  • Save awesomebytes/387ff2eaf845461c92b2 to your computer and use it in GitHub Desktop.

Select an option

Save awesomebytes/387ff2eaf845461c92b2 to your computer and use it in GitHub Desktop.
#!/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