- find ${NAME} -name '*.py'| \
- grep -v -E '^testing/implementation/micropython*' | \
- grep -v -E '^testing/adafruit_blinka.py' | \
- xargs -n1 -I {} sh -c "echo Copying {} ...; ampy --port ${PORT} put {} {}"
+ cd ${SUBMODULE}
+ # create adafruit library directories on board
+ find . -mindepth 1 -type d | \
+ grep -v -E "(^./.git.*|__pycache__|^./doc.*|^./example.*)" | \
+ xargs -n1 -I {} sh -c "echo Creating directory {} ...; ampy --port ${PORT} mkdir --exists-okay {}"
+ # compile adafruit library .py files to .mpy
+ find . -type f -name '*.py' | \
+ grep -v -E "(^./conf.py|^./docs/conf.py|^./setup.py|^./example.*)" | \
+ xargs -n1 -I {} sh -c "echo compiling {} ...; ${MPYCROSS} {}"
+ # upload adafruit library .mpy files
+ find . -type f -name '*.mpy' | \
+ xargs -n1 -I {} sh -c "echo uploading {} ...; ampy --port ${PORT} put {} {}"
+ cd ../