Skip to content

Commit 059657c

Browse files
committed
Cache cleanup
1 parent b0d42d4 commit 059657c

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

debian/arduino-app-cli/DEBIAN/postrm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
rm -rf /var/cache/arduino-app-cli
3+
rm -rf /var/cache/arduino-app-cli/*
44

55
if [ -d /run/systemd/system ]; then
66
systemctl daemon-reload

debian/arduino-app-cli/DEBIAN/prerm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@
33
systemctl disable arduino-app-cli
44
systemctl disable arduino-burn-bootloader
55
systemctl disable arduino-avahi-serial.service
6+
7+
OLD_EXAMPLES_DIR="/home/arduino/.local/share/arduino-app-cli/examples"
8+
9+
if [ -d "OLD_EXAMPLES_DIR" ]; then
10+
for i in /home/arduino/.local/share/arduino-app-cli/examples/*; do
11+
rm -r $i/.cache;
12+
done
13+
fi

internal/orchestrator/orchestrator.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package orchestrator
1818
import (
1919
"bytes"
2020
"context"
21+
"errors"
2122
"fmt"
2223
"io"
2324
"iter"
@@ -908,7 +909,9 @@ func DeleteApp(ctx context.Context, dockerClient command.Cli, app app.ArduinoApp
908909
}
909910
}
910911

911-
return app.FullPath.RemoveAll()
912+
cache_err := app.ProvisioningStateDir().RemoveAll()
913+
data_err := app.FullPath.RemoveAll()
914+
return errors.Join(cache_err, data_err)
912915
}
913916

914917
const defaultAppFileName = "default.app"

0 commit comments

Comments
 (0)