Skip to content

Commit

Permalink
fix: MacOS and Windows test runs for useragent
Browse files Browse the repository at this point in the history
  • Loading branch information
peasee committed Oct 4, 2024
1 parent 9297bd8 commit e52550f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ jobs:
- name: Display Maven version
run: mvn -version

- name: Build
- name: Build (Unix)
if: matrix.os != 'windows-latest'
run: mvn install -DskipTests=true -Dgpg.skip -B -V

- name: Build (Windows)
if: matrix.os == 'windows-latest'
run: mvn --% install -DskipTests=true -Dgpg.skip -B -V # tell powershell to stop parsing with --% so it doesn't error with "Unknown lifecycle phase .skip"

- name: Install Spice (https://install.spiceai.org) (Linux)
if: matrix.os == 'ubuntu-latest'
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/ai/spice/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ public static String getUserAgent() {
osArch = "i386";
}

return "spice-java " + Version.SPICE_JAVA_VERSION + " (" + System.getProperty("os.name") + "/"
// change the os name to match the pattern set in other SDKs
String osName = System.getProperty("os.name");
if (osName.equals("Mac OS X")) {
osName = "Darwin";
}

return "spice-java " + Version.SPICE_JAVA_VERSION + " (" + osName + "/"
+ System.getProperty("os.version") + " "
+ osArch + ")";
}
Expand Down

0 comments on commit e52550f

Please sign in to comment.