bigdl 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. set -e
  3. pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
  4. clean() {
  5. echo "bigdl clean"
  6. rm -rf ./third_party/source/bigdl
  7. }
  8. sync() {
  9. echo "bigdl sync"
  10. mkdir -p "./third_party/source/bigdl/spark/dl/src/main/resources/serialization"
  11. curl --silent --show-error --location --output "./third_party/source/bigdl/spark/dl/src/main/resources/serialization/bigdl.proto" "https://github.com/intel-analytics/BigDL/raw/master/spark/dl/src/main/resources/serialization/bigdl.proto"
  12. }
  13. schema() {
  14. echo "bigdl schema"
  15. [[ $(grep -U $'\x0D' ./source/bigdl-proto.js) ]] && crlf=1
  16. node ./tools/protoc.js --binary --root bigdl --out ./source/bigdl-proto.js ./third_party/source/bigdl/spark/dl/src/main/resources/serialization/bigdl.proto
  17. if [[ -n ${crlf} ]]; then
  18. unix2dos --quiet --newfile ./source/bigdl-proto.js ./source/bigdl-proto.js
  19. fi
  20. }
  21. while [ "$#" != 0 ]; do
  22. command="$1" && shift
  23. case "${command}" in
  24. "clean") clean;;
  25. "sync") sync;;
  26. "schema") schema;;
  27. esac
  28. done