From db1c918e22c0d20a74ff7cf58cac6f126c1f5b7c Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Tue, 22 Feb 2022 09:50:06 +0000 Subject: [PATCH] Convenience scripts --- .deploy/repl.sh | 1 + .deploy/send-it.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 .deploy/repl.sh create mode 100755 .deploy/send-it.sh diff --git a/.deploy/repl.sh b/.deploy/repl.sh new file mode 100755 index 0000000..6cff5ef --- /dev/null +++ b/.deploy/repl.sh @@ -0,0 +1 @@ +screen /dev/tty.usbmo* 115200 diff --git a/.deploy/send-it.sh b/.deploy/send-it.sh new file mode 100755 index 0000000..00d5f04 --- /dev/null +++ b/.deploy/send-it.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -eiu -o pipefail + +DEST=/volumes/CIRCUITPY + +# take the param, strip the filename. +source="$1" +support_files="${@:2}" +sourcebase="$(basename $source)" +# get the filename without the extension. +module="${sourcebase%.py}" + +# empty code.py +echo "" >${DEST}/code.py + +# send the file +cp ${source} ${DEST}/${sourcebase} + +# make a code.py +echo "import ${module}" >${DEST}/code.py + +if [ -n "${support_files}" ]; then + for file in ${support_files}; do + cp "$file" "${DEST}/$(basename "${file}")" + done +fi \ No newline at end of file