om 660 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. set -e
  3. pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
  4. case "${OSTYPE}" in
  5. msys*) python="winpty python";;
  6. *) python="python3";;
  7. esac
  8. schema() {
  9. echo "om schema"
  10. [[ $(grep -U $'\x0D' ./source/om-proto.js) ]] && crlf=1
  11. # https://github.com/Ascend/parser/blob/development/parser/proto/ge_ir.proto
  12. node ./tools/protoc.js --binary --text --root om --out ./source/om-proto.js ./tools/om.proto
  13. if [[ -n ${crlf} ]]; then
  14. unix2dos --quiet --newfile ./source/om-proto.js ./source/om-proto.js
  15. fi
  16. }
  17. while [ "$#" != 0 ]; do
  18. command="$1" && shift
  19. case "${command}" in
  20. "schema") schema;;
  21. esac
  22. done