Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Heiges committed Sep 17, 2023
1 parent e072136 commit 39a842b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function extract (file) {
**/
function followToAdoptium (location) {
if (/api.adoptium.net/g.test(location)) {
return fetch(location, {redirect: 'manual'})
return fetch(location, { redirect: 'manual' })
.then(response => response.headers.get('Location'))
} else return location
}
Expand Down Expand Up @@ -202,7 +202,7 @@ function install (version = 8, options = {}) {
else if (options.vendor === 'eclipse') endpoint = 'api.adoptium.net'
else return Promise.reject(new Error('Unsupported vendor. Use adoptopenjdk (default) or eclipse'))

let version_path = (options.release === 'latest')
const versionPath = (options.release === 'latest')
? 'latest/' + version + '/ga'
: 'version/' + options.release

Expand Down Expand Up @@ -233,18 +233,18 @@ function install (version = 8, options = {}) {
else return Promise.reject(new Error('Unsupported architecture'))
}

let url = 'https://' + endpoint + '/v3/binary/'
+ version_path + '/'
+ options.os + '/'
+ options.arch + '/'
+ options.type + '/'
+ options.openjdk_impl + '/'
+ options.heap_size + '/'
+ options.vendor
const url = 'https://' + endpoint + '/v3/binary/' +
versionPath + '/' +
options.os + '/' +
options.arch + '/' +
options.type + '/' +
options.openjdk_impl + '/' +
options.heap_size + '/' +
options.vendor

const tmpdir = path.join(os.tmpdir(), 'njre')

return fetch(url, {redirect: 'manual'})
return fetch(url, { redirect: 'manual' })
.then(response => response.headers.get('Location'))
.then(location => followToAdoptium(location))
.then(location => downloadAll(tmpdir, location))
Expand Down
2 changes: 1 addition & 1 deletion tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Install', () => {
}).timeout(100000)

it('should install JRE 14 from AdoptOpenJdk without throwing an error', () => {
return njre.install(14, { os: 'linux'})
return njre.install(14, { os: 'linux' })
}).timeout(100000)

it('should install JRE 20 from Eclipse Foundation without throwing an error', () => {
Expand Down

0 comments on commit 39a842b

Please sign in to comment.