Skip to content

Commit ca853c1

Browse files
committed
Add platform aware windows path handling
1 parent b2c8536 commit ca853c1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: utils/path.go

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ func GetDefaultCliConfigPath() string {
1919
switch getGOOS {
2020
case "darwin":
2121
return "Library/Arduino15"
22+
case "windows":
23+
return "AppData\\Local\\Arduino15"
2224
default:
2325
return ".arduino15"
2426
}

Diff for: utils/path_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestGetDefaultCliConfigPath(t *testing.T) {
3333
name: "windows path",
3434
goos: "windows",
3535
user: &user.User{HomeDir: "C:\\Users\\test"},
36-
wantPath: path.Join("C:\\Users\\test", ".arduino15", "arduino-cli.yaml"),
36+
wantPath: path.Join("C:\\Users\\test", "AppData\\Local\\Arduino15", "arduino-cli.yaml"),
3737
},
3838
{
3939
name: "nil user",

0 commit comments

Comments
 (0)