Skip to content

Commit

Permalink
Fix Mac bug (#69)
Browse files Browse the repository at this point in the history
- Fix bug always installing Java 11 on Mac
- Block combination Java 8 + Darwin (Mac)
  • Loading branch information
nvuillam authored May 8, 2024
1 parent cfb1006 commit 82a9144
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Add your updates here !

## [v1.2.1] - 2024-05-08

- Fix bug always installing Java 11 on Mac
- Block combination Java 8 + Darwin (Mac)

## [v1.2.0] - 2024-05-08

- Fix issue with Mac with default values
Expand Down
8 changes: 6 additions & 2 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,14 @@ function install(version = 8, options = {}) {

options = { ...options, openjdk_impl, release, type, heap_size, vendor };

// Java 8 not supported by Api
if (os.platform() === "darwin") {
// Java 8 not supported by Api, set default value to Java 11
if (os.platform() === "darwin" && version === 8) {
version = 11;
}
// Block if use tries impossible combination
if (options.release === "8" && os.platform() === "darwin") {
throw new Error("Java 8 is not available in darwin platform (Mac)")
}

let endpoint = null;
if (options.vendor === "adoptopenjdk") endpoint = "api.adoptopenjdk.net";
Expand Down

0 comments on commit 82a9144

Please sign in to comment.