uff 498 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. set -e
  3. pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
  4. schema() {
  5. echo "uff schema"
  6. [[ $(grep -U $'\x0D' ./source/uff-proto.js) ]] && crlf=1
  7. node ./tools/protoc.js --binary --text --root uff --out ./source/uff-proto.js ./tools/uff.proto
  8. if [[ -n ${crlf} ]]; then
  9. unix2dos --quiet --newfile ./source/uff-proto.js ./source/uff-proto.js
  10. fi
  11. }
  12. while [ "$#" != 0 ]; do
  13. command="$1" && shift
  14. case "${command}" in
  15. "schema") schema;;
  16. esac
  17. done