dl4j 692 B

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