Skip to content

Commit eb43362

Browse files
committed
Fully sinc lib folder to delete old files
1 parent abc7103 commit eb43362

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

circuitpython_tools.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ subject="main.py" # TODO: parameterize
3131

3232
function deploy() {
3333
rm -rf "_build/"
34+
mkdir "_build/"
3435

3536
# Compile .py files to .mpy and move to _build
3637
for file in lib/*.py lib/**/*.py; do
@@ -47,10 +48,17 @@ function deploy() {
4748
cp -v "$file" "_build/$file"
4849
done
4950

51+
# Sync subject
5052
rsync \
5153
--archive --verbose --compress \
52-
"_build/" \
54+
"_build/$subject" \
5355
"$device"
56+
57+
# Fully sync lib folder, deleting alien files
58+
rsync \
59+
--archive --verbose --compress --delete \
60+
"_build/lib/" \
61+
"$device/lib"
5462
}
5563

5664
function watch() {

0 commit comments

Comments
 (0)