Skip to content

Commit 8dc5560

Browse files
committed
Backport of fix for MacOs.
1 parent 37fd267 commit 8dc5560

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/kotlin/kscript/app/model/OsType.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ enum class OsType(val osName: String) {
99

1010
companion object {
1111
fun findOrThrow(name: String) =
12-
values().find { it.osName.equals(name, true) } ?: throw IllegalArgumentException("Unsupported OS: $name")
12+
//Exact comparison (it.osName.equals(name, true)) seems to be not feasible as there is also e.g. "darwin21"
13+
//and maybe even other osTypes: specific versions of os'es shouldn't belong to OsType.
14+
values().find { name.contains(it.osName, true) } ?: throw IllegalArgumentException("Unsupported OS: $name")
1315
}
1416
}

0 commit comments

Comments
 (0)