Skip to content

Commit 902fb61

Browse files
orchestrator: change default apps and data folder (#462)
1 parent 4af7aa9 commit 902fb61

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ build/
3434
/arduino-app-cli
3535
/apps
3636
# temporary staging directories
37-
/debian/orchestrator/home/arduino/.arduino-app-cli/examples
37+
/debian/orchestrator/home

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ NOTE: currently the mac-os is not supported since the `github.com/arduino/arduin
248248

249249
### Orchestrator configurations
250250

251-
The orchestrator will write apps in `~/arduino-apps` folder, and examples in `~/.arduino-app-cli/examples`.
251+
The orchestrator will write apps in `~/arduino-apps` folder, and examples in `~/.config/arduino-app-cli/examples`.
252252
To override the path provide the following flags:
253253

254254
- `ARDUINO_APP_CLI__APPS_DIR`

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ tasks:
107107
set -e
108108
echo "Runner version set as: {{ .EXAMPLE_VERSION }}"
109109
TMP_PATH="$(mktemp -d)"
110-
DEST_PATH="debian/orchestrator/home/arduino/.arduino-app-cli/"
110+
DEST_PATH="debian/orchestrator/home/arduino/.config/arduino-app-cli/"
111111
echo "Cloning bcmi-labs/app-bricks-example into temporary directory ${TMP_PATH}..."
112112
git clone --depth 1 --branch "{{ .EXAMPLE_VERSION }}" https://github.com/bcmi-labs/app-bricks-example "${TMP_PATH}"
113113
rm -rf "${DEST_PATH}"

debian/orchestrator/etc/systemd/system/arduino-orchestrator.service

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Requires=docker.service arduino-router.service
88
ExecStart=/usr/bin/arduino-app-cli daemon --port 8800
99
User=arduino
1010
Group=arduino
11-
Environment="ARDUINO_APP_CLI__APPS_DIR=/home/arduino/arduino-apps"
12-
Environment="ARDUINO_APP_CLI__DATA_DIR=/home/arduino/.arduino-app-cli"
1311
Environment="ARDUINO_APP_CLI__LOG_LEVEL=ERROR"
1412
Environment="ARDUINO_ROUTER_SOCKET=/var/run/arduino-router.sock"
1513
StandardOutput=journal

internal/orchestrator/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ func NewOrchestratorConfigFromEnv() (*OrchestratorConfig, error) {
3232

3333
dataDir := paths.New(os.Getenv("ARDUINO_APP_CLI__DATA_DIR"))
3434
if dataDir == nil {
35-
home, err := os.UserHomeDir()
35+
xdgConfig, err := os.UserConfigDir()
3636
if err != nil {
3737
return nil, err
3838
}
39-
dataDir = paths.New(home).Join(".arduino-app-cli")
39+
dataDir = paths.New(xdgConfig).Join("arduino-app-cli")
4040
}
4141
if !dataDir.IsAbs() {
4242
wd, err := paths.Getwd()

0 commit comments

Comments
 (0)