2017-07-06 13:24:21 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
LEGO=$HOME/src/lego/lms2012
|
2017-07-06 18:34:31 +02:00
|
|
|
P="`pwd`"
|
|
|
|
F="$P"/pxt
|
2017-07-07 14:08:36 +02:00
|
|
|
set -e
|
2017-07-06 13:24:21 +02:00
|
|
|
cd $LEGO/lmssrc/adk/lmsasm
|
2017-07-07 14:08:36 +02:00
|
|
|
echo "Compiling..."
|
2017-07-06 13:24:21 +02:00
|
|
|
java -jar assembler.jar $F
|
2017-07-06 18:34:31 +02:00
|
|
|
cd "$P"
|
2017-07-07 14:08:36 +02:00
|
|
|
echo "Hex to paste:"
|
|
|
|
echo
|
|
|
|
echo "const rbfTemplate = \`"
|
|
|
|
node -p 'require("fs").readFileSync("pxt.rbf").toString("hex").replace(/5858585858(58)+/, "XX").replace(/.{1,80}/g, f => f + "\n").trim()'
|
|
|
|
echo "\`"
|
|
|
|
echo
|
|
|
|
rm -f pxt.rbf
|