]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Ampy-based selective integration-test upload routine for Huzzah running CircuitPython
authorCefn Hoile <github.com@cefn.com>
Sun, 18 Feb 2018 20:18:26 +0000 (20:18 +0000)
committerCefn Hoile <github.com@cefn.com>
Sun, 18 Feb 2018 20:18:26 +0000 (20:18 +0000)
python/upload_feather_huzzah_circuitpython_put.sh [new file with mode: 0755]

diff --git a/python/upload_feather_huzzah_circuitpython_put.sh b/python/upload_feather_huzzah_circuitpython_put.sh
new file mode 100755 (executable)
index 0000000..5a4b91a
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+PORT=/dev/ttyUSB0
+
+# create only relevant directories on the board
+find testing -type d | \
+        grep -v -E "(.(git|idea|vscode)|__pycache__)" | \
+        grep -v -E '^testing/implementation/micropython*' | \
+        xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir {}"
+
+# put top-level modules in place
+for NAME in agnostic unittest
+do
+    echo "Copying ${NAME}.py ..."
+    ampy --port ${PORT} put ${NAME}.py ${NAME}.py
+done
+
+# recursively sync module folders excluding packages
+# already provided by circuitpython, and excluding
+# testing packages targeting micropython
+for NAME in testing
+do
+    find ${NAME} -name '*.py'| \
+    grep -v -E '^testing/implementation/micropython*' | \
+    grep -v -E '^testing/mcp.py' | \
+    xargs -n1 -I {} sh -c "echo Copying {} ...; ampy --port ${PORT} put {} {}"
+done