Improve the setup helpers
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
screen /dev/tty.usbmo* 115200
|
screen /dev/tty.usbmo* 115200
|
||||||
|
|||||||
+7
-7
@@ -5,8 +5,8 @@ DEST=/volumes/CIRCUITPY
|
|||||||
|
|
||||||
# take the param, strip the filename.
|
# take the param, strip the filename.
|
||||||
source="$1"
|
source="$1"
|
||||||
support_files="${@:2}"
|
support_files=( "${@:2}" )
|
||||||
sourcebase="$(basename $source)"
|
sourcebase="$(basename "$source")"
|
||||||
# get the filename without the extension.
|
# get the filename without the extension.
|
||||||
module="${sourcebase%.py}"
|
module="${sourcebase%.py}"
|
||||||
|
|
||||||
@@ -14,13 +14,13 @@ module="${sourcebase%.py}"
|
|||||||
echo "" >${DEST}/code.py
|
echo "" >${DEST}/code.py
|
||||||
|
|
||||||
# send the file
|
# send the file
|
||||||
cp ${source} ${DEST}/${sourcebase}
|
cp "${source}" "${DEST}/${sourcebase}"
|
||||||
|
|
||||||
# make a code.py
|
# make a code.py
|
||||||
echo "import ${module}" >${DEST}/code.py
|
echo "import ${module}" >"${DEST}/code.py"
|
||||||
|
|
||||||
if [ -n "${support_files}" ]; then
|
if [ -n "${support_files[*]}" ]; then
|
||||||
for file in ${support_files}; do
|
for file in "${support_files[@]}"; do
|
||||||
cp "$file" "${DEST}/$(basename "${file}")"
|
cp "$file" "${DEST}/$(basename "${file}")"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -eiu -o pipefail
|
||||||
|
|
||||||
|
DEST=/volumes/CIRCUITPY
|
||||||
|
LIBRARY_SRC=/Users/danielstaple/git_work/projects_in_cloud/book_authoring/book-research/pico-book-research/circuitpython/3rdparty/built/adafruit-circuitpython-bundle-7.x-mpy-20220228
|
||||||
|
|
||||||
|
FILES=(adafruit_pioasm.mpy adafruit_requests.mpy adafruit_vl53l1x.mpy)
|
||||||
|
FOLDERS=(adafruit_wsgi adafruit_esp32spi)
|
||||||
|
|
||||||
|
for file in "${FILES[@]}"; do
|
||||||
|
cp -v "${LIBRARY_SRC}/lib/${file}" "${DEST}/lib/${file}"
|
||||||
|
done
|
||||||
|
|
||||||
|
for folder in "${FOLDERS[@]}"; do
|
||||||
|
rsync -rv "${LIBRARY_SRC}/lib/${folder}" "${DEST}/lib/${folder}"
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user