Skip to content

Commit 287bfd6

Browse files
committed
Skip compilation w/o mpy_cross alias
This actually does nothing since it's defined on line 6, but you can comment it out to see its intention.
1 parent eb43362 commit 287bfd6

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

circuitpython_tools.sh

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,25 @@ function deploy() {
3333
rm -rf "_build/"
3434
mkdir "_build/"
3535

36-
# Compile .py files to .mpy and move to _build
37-
for file in lib/*.py lib/**/*.py; do
38-
path_without_extension=$(echo "$file" | cut -f 1 -d '.')
39-
mpy_path="$path_without_extension.mpy"
40-
echo "$file -> $mpy_path"
41-
mpy_cross $file
42-
mkdir -p "$(dirname "_build/$file")"
43-
mv -f -v "$mpy_path" "_build/$mpy_path"
44-
done
45-
46-
# Copy subject and any remaining .mpy files to _build
47-
for file in "$subject" lib/*.mpy lib/**/*.mpy; do
48-
cp -v "$file" "_build/$file"
49-
done
36+
if [ -z "$(alias | grep mpy_cross)" ]; then
37+
# Plain copy stuff to _build, w/o actually building
38+
cp -r "$subject" lib _build
39+
else
40+
# Compile .py files to .mpy and move to _build
41+
for file in lib/*.py lib/**/*.py; do
42+
path_without_extension=$(echo "$file" | cut -f 1 -d '.')
43+
mpy_path="$path_without_extension.mpy"
44+
echo "$file -> $mpy_path"
45+
mpy_cross $file
46+
mkdir -p "$(dirname "_build/$file")"
47+
mv -f -v "$mpy_path" "_build/$mpy_path"
48+
done
49+
50+
# Copy subject and any remaining .mpy files to _build
51+
for file in "$subject" lib/*.mpy lib/**/*.mpy; do
52+
cp -v "$file" "_build/$file"
53+
done
54+
fi
5055

5156
# Sync subject
5257
rsync \

0 commit comments

Comments
 (0)