Skip to content

Commit

Permalink
Detect more osx variants (#67)
Browse files Browse the repository at this point in the history
Motivation:

It looks like some JDK implementations do neither return `macosx` or `osx` for `System.getProperty("os.arch")`.

Modifications:

- Return `osx` when `os.arch` starts with `mac` instead of `macosx`, so that the plugin detects both `mac` and `macosx`.

Result:

- Fixes #58
  • Loading branch information
trustin committed Nov 7, 2022
1 parent cebc3e8 commit 88bae1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -14,7 +14,7 @@
* `hpux` - if the value starts with `hpux`
* `os400` - if the value starts with `os400` and its following character is *not* a digit (e.g. `os4000`)
* `linux` - if the value starts with `linux`
* `osx` - if the value starts with `macosx` or `osx`
* `osx` - if the value starts with `mac` or `osx`
* `freebsd` - if the value starts with `freebsd`
* `openbsd` - if the value starts with `openbsd`
* `netbsd` - if the value starts with `netbsd`
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/kr/motd/maven/os/Detector.java
Expand Up @@ -164,7 +164,7 @@ private static String normalizeOs(String value) {
if (value.startsWith("linux")) {
return "linux";
}
if (value.startsWith("macosx") || value.startsWith("osx")) {
if (value.startsWith("mac") || value.startsWith("osx")) {
return "osx";
}
if (value.startsWith("freebsd")) {
Expand Down

0 comments on commit 88bae1e

Please sign in to comment.