2
0

torch 602 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. set -e
  3. pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
  4. bold() {
  5. echo "$(tty -s && tput bold)$1$(tty -s && tput sgr0)"
  6. }
  7. clean() {
  8. bold "torch clean"
  9. rm -rf "./third_party/src/torch"
  10. }
  11. sync() {
  12. bold "torch sync"
  13. [ -d "./third_party/src/torch" ] || git clone --quiet https://github.com/torch/torch7.git "./third_party/src/torch"
  14. pushd "./third_party/src/torch" > /dev/null
  15. git pull --quiet --prune
  16. popd > /dev/null
  17. }
  18. while [ "$#" != 0 ]; do
  19. command="$1" && shift
  20. case "${command}" in
  21. "clean") clean;;
  22. "sync") sync;;
  23. esac
  24. done