From: Cefn Hoile Date: Sat, 17 Feb 2018 01:08:01 +0000 (+0000) Subject: File upload routine to complement https://github.com/ShrimpingIt/cockle/blob/1d593448... X-Git-Tag: 0.1.0~4^2~150 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/8caab7332b3d2d10eceeb2400db626bb7f92ad5a File upload routine to complement https://github.com/ShrimpingIt/cockle/blob/1d593448f6f623bc3c0eb779951612d9b76715e3/deployall.py for firmare image upload when testing --- diff --git a/python/put.sh b/python/put.sh new file mode 100755 index 0000000..3a6cb0e --- /dev/null +++ b/python/put.sh @@ -0,0 +1,18 @@ +#!/bin/sh +PORT=/dev/ttyUSB0 + +# filter directories, and create relevant ones on the board +find . -mindepth 1 -type d | grep -v -E "(.(git|idea|vscode)|__pycache__)" | xargs -n1 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 folders of nested packages +for NAME in board digitalio mcp microcontroller testing +do + find ${NAME} -name '*.py'| xargs -n1 -I {} sh -c "echo Copying {} ...; ampy --port ${PORT} put {} {}" +done