| 123456789101112131415161718192021222324252627282930313233343536373839 |
- #!/bin/bash
- set -e
- pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
- case "${OSTYPE}" in
- msys*) python="winpty python";;
- *) python="python";;
- esac
- clean() {
- echo "executorch clean"
- rm -rf "./third_party/source/executorch"
- }
- sync() {
- echo "executorch sync"
- mkdir -p "./third_party/source/executorch/schema"
- curl --silent --location --output "./third_party/source/executorch/schema/scalar_type.fbs" "https://github.com/pytorch/executorch/raw/main/schema/scalar_type.fbs"
- curl --silent --location --output "./third_party/source/executorch/schema/program.fbs" "https://github.com/pytorch/executorch/raw/main/schema/program.fbs"
- }
- schema() {
- echo "executorch schema"
- [[ $(grep -U $'\x0D' ./source/executorch-schema.js) ]] && crlf=1
- node ./tools/flatc.js --root torch --out ./source/executorch-schema.js ./third_party/source/executorch/schema/program.fbs
- if [[ -n ${crlf} ]]; then
- unix2dos --quiet --newfile ./source/executorch-schema.js ./source/executorch-schema.js
- fi
- }
- while [ "$#" != 0 ]; do
- command="$1" && shift
- case "${command}" in
- "clean") clean;;
- "sync") sync;;
- "schema") schema;;
- esac
- done
|