Skip to content

Commit 7351871

Browse files
committed
Minor
1 parent 641bf62 commit 7351871

File tree

5 files changed

+11
-21
lines changed

5 files changed

+11
-21
lines changed

debian/arduino-app-cli/DEBIAN/postinst

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

3-
#chown -R arduino:arduino /home/arduino/.local/share/arduino-app-cli
43
mkdir /var/cache/arduino-app-cli
54
chown -R arduino:arduino /var/cache/arduino-app-cli
65
mkdir /home/arduino/.arduino-app-cli

debian/arduino-app-cli/DEBIAN/postrm

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

3-
# TODO delete /var/cache
43
rm -rf /var/cache/arduino-app-cli
54

65
if [ -d /run/systemd/system ]; then

docs/user-documentation.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The following environment variables are used to configure Arduino App CLI:
77
| Environment Variable | Default Value | Description |
88
| -------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------- |
99
| `ARDUINO_APP_CLI__APPS_DIR` | `/home/arduino/ArduinoApps` | Path to the directory where Arduino Apps created by the user are stored |
10-
| `ARDUINO_APP_CLI__DATA_DIR` | `/home/arduino/.local/share/arduino-app-cli` | Path to the directory where internal data is stored (examples, assets, properties) |
10+
| `ARDUINO_APP_CLI__DATA_DIR` | `/usr/share/arduino-app-cli` | Path to the directory where internal data is stored (examples, assets) |
1111
| `ARDUINO_APP_BRICKS__CUSTOM_MODEL_DIR` | `$HOME/.arduino-bricks/ei-models` | Path to the directory where custom AI models are stored |
1212
| `ARDUINO_APP_CLI__ALLOW_ROOT` | `false` | Allow running `arduino-app-cli` as root (**Not recommended to set to true**) |
1313
| `LIBRARIES_API_URL` | `https://api2.arduino.cc/libraries/v1/libraries` | URL of the external service used to search Arduino libraries |
@@ -33,19 +33,14 @@ Examples of user-defined Arduino Apps stored under the `ARDUINO_APP_CLI__APPS_DI
3333
├── python
3434
   └── main.py
3535
```
36-
37-
Examples of the `assets` and the builtin `examples` stored under the `ARDUINO_APP_CLI__DATA_DIR` folder.
38-
36+
Examples of the `assets` and the builtin `examples` are stored under the `ARDUINO_APP_CLI__DATA_DIR` folder.
3937
```
40-
/home/arduino/.local/share/arduino-app-cli/
38+
/usr/share/arduino-app-cli/
4139
├── assets
4240
│   └── 0.5.0 # Version-specific assets
4341
│   ├── bricks-list.yaml # Available bricks
4442
│   ├── models-list.yaml # Available models
4543
│   └── ...
46-
├── bootloader_burned.flag
47-
├── default.app # Default App
48-
├── properties.msgpack # Variable values
4944
├── examples # Built-in App examples
5045
│   ├── air-quality-monitoring
5146
│   │   ├── app.yaml
@@ -60,3 +55,6 @@ Examples of the `assets` and the builtin `examples` stored under the `ARDUINO_AP
6055
│   │   └── README.md
6156
│   └── ...
6257
```
58+
59+
Package configurations are located in ```/home/arduino/.arduino-app-cli```
60+
Runtime data are other files are in ```/var/lib/arduino-app-cli```

internal/api/handlers/properties.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ import (
3030
)
3131

3232
func getPropertiesDir() string {
33-
xdgHome, _ := os.UserHomeDir()
34-
//if err != nil {
35-
// slog.Error("Unable to retrieve list", slog.String("error", err.Error()))
36-
//}
33+
xdgHome, err := os.UserHomeDir()
34+
if err != nil {
35+
slog.Error("Unable to set user home", slog.String("error", err.Error()))
36+
}
3737
return paths.New(xdgHome).Join(".arduino-app-cli", "properties.msgpack").String()
3838
}
3939

internal/orchestrator/config/config.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,7 @@ func NewFromEnv() (Configuration, error) {
6363

6464
dataDir := paths.New(os.Getenv("ARDUINO_APP_CLI__DATA_DIR"))
6565
if dataDir == nil {
66-
dataDir = paths.New("/", "usr", "share", "arduino-app-cli")
67-
slog.Info("ARDUINO_APP_CLI__DATA_DIR unset, use default", slog.String("ARDUINO_APP_CLI__DATA_DIR", dataDir.String()))
68-
if dataDir == nil {
69-
return Configuration{}, errors.New("unable to create data dir")
70-
}
71-
} else {
72-
slog.Info("ARDUINO_APP_CLI__DATA_DIR override", slog.String("ARDUINO_APP_CLI__DATA_DIR", dataDir.String()))
66+
dataDir = paths.New("/usr/share/arduino-app-cli")
7367
}
7468

7569
routerSocket := paths.New(os.Getenv("ARDUINO_ROUTER_SOCKET"))

0 commit comments

Comments
 (0)