#!/bin/bash
#
# This script downloads the base CRAM repositories from their
# respective GitHub URLs and checks out the version tag given as
# parameter.
#
# Should any questions arise, don't hesitate to drop a mail to
# Jan Winkler .
#
# Example usage: $ ./cram_tag_co.sh v0.1
# Will check out the version 'v0.1' of all mentioned CRAM
# components.
#
# Script version as of March 15th, 2013.
#
TAG_NAME=$1
COMPONENTS=(cram_core cram_highlevel cram_gazebo cram_physics cram_pr2)
echo "Checking out tagged version '${TAG_NAME}'."
for item in ${COMPONENTS[*]}
do
if [ ! -e ./${item} ] ; then
git clone https://github.com/cram-code/${item}.git ${item}
fi
cd ${item}
git checkout ${TAG_NAME}
cd ..
done
=== Checking out the current Version ===
To download the latest version (assuming the script is in the file //cram_tag_co.sh//), do first give execution rights to the script and then run it:
$ chmod +x cram_tag_co.sh
$ ./cram_tag_co.sh
The latest version might include changes that are not yet part of the full-fledged tagged version. Be sure to always check out the current code when there is no pressing reason to download a specific tagged version.
=== Checking out specific Versions ===
To download the code and check out version **v0.1.1**, do this (assuming the script is in the file //cram_tag_co.sh//):
$ chmod +x cram_tag_co.sh
$ ./cram_tag_co.sh v0.1.1
You can then find the downloaded and checked out files in their respective subdirectories. In case the repositories were downloaded already, only differing changes are downloaded from GitHub. The version tag is then checked out on each repository.