Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: map "darwin" agents as macOS
  • Loading branch information
fioan89 committed Dec 22, 2022
commit 4927e4177a1d2bcd2ddf85488dd00388c48490fb
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
- workspaces and agents are now resolved and displayed progressively

### Fixed
- icon rendering on macOS
- icon rendering on `macOS`
- `darwin` agents are now recognized as `macOS`

## 2.1.3 - 2022-12-09

Expand Down
6 changes: 4 additions & 2 deletions src/main/kotlin/com/coder/gateway/sdk/os.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.coder.gateway.sdk

import java.util.Locale

fun getOS(): OS? {
return OS.from(System.getProperty("os.name"))
}

fun getArch(): Arch? {
return Arch.from(System.getProperty("os.arch").toLowerCase())
return Arch.from(System.getProperty("os.arch").lowercase(Locale.getDefault()))
}

enum class OS {
Expand All @@ -22,7 +24,7 @@ enum class OS {
LINUX
}

os.contains("mac", true) -> {
os.contains("mac", true) || os.contains("darwin", true) -> {
MAC
}

Expand Down