Skip to content

Commit

Permalink
Replace macos-release by (parseInt(os.version()) - 9)
Browse files Browse the repository at this point in the history
* That way we don't need to update that dependency to work with newer macOS releases.
  • Loading branch information
eregon committed Sep 25, 2024
1 parent 4498ab3 commit ae36c51
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 94 deletions.
6 changes: 4 additions & 2 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const core = require('@actions/core')
const tc = require('@actions/tool-cache')
const { performance } = require('perf_hooks')
const linuxOSInfo = require('linux-os-info')
import macosRelease from 'macos-release'

export const windows = (os.platform() === 'win32')
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
Expand Down Expand Up @@ -239,7 +238,10 @@ export function getOSVersion() {
const info = linuxOSInfo({mode: 'sync'})
osVersion = info.version_id
} else if (platform === 'darwin') {
osVersion = macosRelease().version
// See https://github.com/sindresorhus/macos-release/blob/main/index.js
console.log("os.release() = " + os.release())
const darwinVersion = Number(os.release().split('.', 1)[0])
osVersion = `${darwinVersion - 9}`
} else if (platform === 'win32') {
osVersion = findWindowsVersion()
} else {
Expand Down
130 changes: 44 additions & 86 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^2",
"linux-os-info": "^2.0.0",
"macos-release": "^3.3.0",
"semver": "^7.3.7"
},
"devDependencies": {
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ae36c51

Please sign in to comment.