#!/bin/bash

#if [ -z "$1" ]
#then
#    svn co https://svn.orxonox.ethz.ch/data data
#else
#    svn co https://svn.orxonox.ethz.ch/data data --username $1
#fi

if [ "$1" = "md2_loader" ]
then
    echo "COOL"
fi


case "$1" in

  # md2_loader branche specific stuff
  "md2_loader" | "md2" )
  echo "(II) md2_loader branche specific data is been loaded"
  echo "(II) this just works on linux and on mac OS X"
  echo

  if [ -e data ]
  then
    wget http://www.orxonox.ethz.ch/files/data_additions/md2_loader/md2_loader_pack.tar.bz2
    mv md2_loader_pack.tar.bz2 data/
    cd data
    tar -jxf md2_loader_pack.tar.bz2 
    rm md2_loader_pack.tar.bz2
    cd ..
    echo
    echo "(II) Update finished successfully!"
  else
    echo
    echo "(EE) there is no data directory here"
  fi
  ;;

  # default case
  * )
  if [ -z "$1" ]
  then
    svn co https://svn.orxonox.ethz.ch/data data
  else
    svn co https://svn.orxonox.ethz.ch/data data --username $1
  fi
  ;;

esac

