Advertisement
LordAro

autohgpull.sh

Apr 26th, 2011
147
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. error() {
  4.   echo "FATAL ERROR: $@." >&2
  5.   exit 1;
  6. }
  7.  
  8. NAME_PROGRAM=$(basename "$0")
  9. NUM_PARAMS=2 #3rd not required
  10. HG_COMMAND=$1
  11. PULL_DIR=$2
  12. BASE_DIR=$3
  13. if [ $3 == "" ]
  14. $$BASE_DIR="default"
  15. fi # <-- syntax error near unexpected token `fi'
  16.  
  17. [$NUM_PARAMS -eq $# ] || error "$NAME_PROGRAM requires $NUM_PARAMS parameters, only $# provided"
  18.  
  19.  
  20. echo "$NAME_PROGRAM started"
  21. #if [ ! -d ".hg" ]; then
  22. #   HG_COMMAND="clone"
  23. #fi
  24.  
  25. echo "Pulling $PULL_DIR to $BASE_DIR."
  26. hg $HG_COMMAND $PULL_DIR $BASE_DIR
  27. echo "Done!"
  28. echo ""
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement