forked from microsoft/devicescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·35 lines (33 loc) · 775 Bytes
/
run.sh
File metadata and controls
executable file
·35 lines (33 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
echo "compile..."
node ../node_modules/typescript/bin/tsc || exit 1
echo "process..."
node build/process.js bytecode.md
R=$?
if [ $R = 10 ] ; then
diff -u bytecode.md bytecode.md.new
read -p "apply changes [y/n]? " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
mv bytecode.md.new bytecode.md
node build/process.js bytecode.md
R=$?
fi
if [ $R != 0 ] ; then
echo "exit $R"
exit $R
fi
set -x
set -e
cp build/bytecode.ts ../compiler/src/
cp build/devs_bytecode.h ../runtime/jacdac-c/devicescript/devs_bytecode.h
clang-format -i ../runtime/jacdac-c/devicescript/devs_bytecode.h
prettier -w ../compiler/src/bytecode.ts
MC=../../../microcode
if test -d $MC ; then
cp build/devs_bytecode.ts $MC
prettier -w $MC/devs_bytecode.ts
fi