From 8caab7332b3d2d10eceeb2400db626bb7f92ad5a Mon Sep 17 00:00:00 2001 From: Cefn Hoile Date: Sat, 17 Feb 2018 01:08:01 +0000 Subject: [PATCH] File upload routine to complement https://github.com/ShrimpingIt/cockle/blob/1d593448f6f623bc3c0eb779951612d9b76715e3/deployall.py for firmare image upload when testing --- python/put.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 python/put.sh 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 -- 2.49.0