Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Use apache commons for arch and name detection
Browse files Browse the repository at this point in the history
  • Loading branch information
KendallWeihe committed Aug 9, 2024
1 parent a79b833 commit d7a591d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions bound/kt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@
<artifactId>kotlinx-coroutines-core</artifactId>
<version>${version.org.jetbrains.kotlinx.kotlinx.coroutines.core}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.16.0</version>
</dependency>

<!-- Test Dependency Management -->
<dependency>
Expand Down Expand Up @@ -231,6 +236,10 @@
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<!-- Test Dependencies -->
<dependency>
Expand Down
5 changes: 3 additions & 2 deletions bound/kt/src/main/kotlin/tbdex/sdk/rust/SystemArchitecture.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tbdex.sdk.rust

import java.io.File
import org.apache.commons.lang3.SystemUtils

object SystemArchitecture {
@Volatile
Expand All @@ -18,8 +19,8 @@ object SystemArchitecture {
if (!isSet) {
synchronized(this) {
if (!isSet) {
val arch = System.getProperty("os.arch")?.lowercase() ?: throw Exception("Unable to get OS arch")
val name = System.getProperty("os.name")?.lowercase() ?: throw Exception("Unable to get OS name")
val arch = SystemUtils.OS_ARCH.lowercase()
val name = SystemUtils.OS_NAME.lowercase()

log("System architecture: $arch")
log("Operating system name: $name")
Expand Down

0 comments on commit d7a591d

Please sign in to comment.