Skip to content

Commit b5d8b53

Browse files
authored
fix: add windows support for developing
1 parent 8db63a7 commit b5d8b53

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

internal/orchestrator/orchestrator.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"os/user"
1212
"path"
1313
"path/filepath"
14+
"runtime"
1415
"slices"
1516

1617
"github.com/arduino/arduino-cli/commands"
@@ -290,8 +291,11 @@ func AppDetails(ctx context.Context, app parser.App) (AppDetailsResult, error) {
290291
}
291292

292293
func getCurrentUser() string {
293-
// Map user to avoid permission issues.
294294
// MacOS and Windows uses a VM so we don't need to map the user.
295+
if runtime.GOOS == "darwin" || runtime.GOOS == "windows" {
296+
return ""
297+
}
298+
// Map user to avoid permission issues.
295299
user, err := user.Current()
296300
if err != nil {
297301
panic(err)
@@ -300,6 +304,11 @@ func getCurrentUser() string {
300304
}
301305

302306
func getDevices() []string {
307+
// Ignore devices on Windows
308+
if runtime.GOOS == "windows" {
309+
return nil
310+
}
311+
303312
deviceList, err := paths.New("/dev").ReadDir()
304313
if err != nil {
305314
panic(err)

0 commit comments

Comments
 (0)