]> Repositories - Adafruit_Blinka-hackapet.git/blob - python/upload_feather_huzzah_circuitpython_put.sh
Updated for new testing structure
[Adafruit_Blinka-hackapet.git] / python / upload_feather_huzzah_circuitpython_put.sh
1 #!/bin/sh
2 PORT=/dev/ttyUSB0
3
4 # create only relevant directories on the board
5 find testing -type d | \
6         grep -v -E "(.(git|idea|vscode)|__pycache__)" | \
7         grep -v -E '^testing/implementation/micropython*' | \
8         xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir {}"
9
10 # put top-level modules in place
11 for NAME in agnostic unittest
12 do
13     echo "Copying ${NAME}.py ..."
14     ampy --port ${PORT} put ${NAME}.py ${NAME}.py
15 done
16
17 # recursively sync module folders excluding packages
18 # already provided by circuitpython, and excluding
19 # testing packages targeting micropython
20 for NAME in testing
21 do
22     find ${NAME} -name '*.py'| \
23     grep -v -E '^testing/implementation/micropython*' | \
24     grep -v -E '^testing/mcp.py' | \
25     xargs -n1 -I {} sh -c "echo Copying {} ...; ampy --port ${PORT} put {} {}"
26 done