Files
wehub-resource-sync 7254f7b4d1
Build / Build (macos-latest) (push) Waiting to run
Build / Build (ubuntu-latest) (push) Waiting to run
Build / Build (windows-latest) (push) Waiting to run
Build / Analyze (javascript) (push) Waiting to run
Build / Analyze (python) (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 12:37:45 +08:00

44 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -e
pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
clean() {
echo "circle clean"
rm -rf "./third_party/source/circle"
}
sync() {
echo "circle sync"
mkdir -p "./third_party/source/circle/nnpackage/schema"
curl --silent --show-error --location --output "./third_party/source/circle/nnpackage/schema/circle_schema.fbs" "https://github.com/Samsung/ONE/raw/master/nnpackage/schema/circle_schema.fbs"
}
schema() {
echo "circle schema"
[[ $(grep -U $'\x0D' ./source/circle-schema.js) ]] && crlf=1
node ./tools/flatc.js --text --root circle --out ./source/circle-schema.js ./third_party/source/circle/nnpackage/schema/circle_schema.fbs
if [[ -n ${crlf} ]]; then
unix2dos --quiet --newfile ./source/circle-schema.js ./source/circle-schema.js
fi
}
metadata() {
echo "circle metadata"
if [[ $(grep -U $'\x0D' ./source/circle-metadata.json) ]]; then crlf=1; else crlf=; fi
node ./tools/circle-script.js
if [[ -n ${crlf} ]]; then
unix2dos --quiet --newfile ./source/circle-metadata.json ./source/circle-metadata.json
fi
}
while [ "$#" != 0 ]; do
command="$1" && shift
case "${command}" in
"clean") clean;;
"sync") sync;;
"schema") schema;;
"metadata") metadata;;
esac
done