pull-repo-base.sh 330 B

123456789101112131415
  1. #! /usr/bin/env bash
  2. REMOTE_REPO=$1
  3. LOCAL_WORKSPACE=$2
  4. if [ -z $REMOTE_REPO -o -z $LOCAL_WORKSPACE ]; then
  5. echo "invalid call pull-repo.sh '$REMOTE_REPO' '$LOCAL_WORKSPACE'"
  6. elif [ ! -d $LOCAL_WORKSPACE ]; then
  7. git clone $REMOTE_REPO $LOCAL_WORKSPACE
  8. else
  9. cd $LOCAL_WORKSPACE
  10. git fetch --all --tags
  11. cd -
  12. fi