feat: skip graphviz installation on older MacOS

f
This commit is contained in:
Amin Yahyaabadi 2024-02-16 14:19:55 -08:00
parent 88ef2fc50d
commit 5465644a17
No known key found for this signature in database
GPG Key ID: F52AF77F636088F0
10 changed files with 44 additions and 18 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -102,6 +102,7 @@
"execa": "^7.2.0", "execa": "^7.2.0",
"is-url-online": "^1.5.0", "is-url-online": "^1.5.0",
"jest": "^29.7.0", "jest": "^29.7.0",
"macos-release": "^3.2.0",
"micro-memoize": "^4.1.2", "micro-memoize": "^4.1.2",
"mkdirp": "^3.0.1", "mkdirp": "^3.0.1",
"mri": "^1.2.0", "mri": "^1.2.0",

View File

@ -104,6 +104,9 @@ importers:
jest: jest:
specifier: ^29.7.0 specifier: ^29.7.0
version: 29.7.0(@types/node@20.11.5)(ts-node@10.9.2) version: 29.7.0(@types/node@20.11.5)(ts-node@10.9.2)
macos-release:
specifier: ^3.2.0
version: 3.2.0
micro-memoize: micro-memoize:
specifier: ^4.1.2 specifier: ^4.1.2
version: 4.1.2 version: 4.1.2
@ -7655,6 +7658,11 @@ packages:
engines: {node: '>=12'} engines: {node: '>=12'}
dev: true dev: true
/macos-release@3.2.0:
resolution: {integrity: sha512-fSErXALFNsnowREYZ49XCdOHF8wOPWuFOGQrAhP7x5J/BqQv+B02cNsTykGpDgRVx43EKg++6ANmTaGTtW+hUA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: true
/make-dir@2.1.0: /make-dir@2.1.0:
resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==}
engines: {node: '>=6'} engines: {node: '>=6'}

View File

@ -17,6 +17,7 @@ import { isUbuntu } from "../utils/env/isUbuntu"
import { pathExists } from "path-exists" import { pathExists } from "path-exists"
import retry from "retry-as-promised" import retry from "retry-as-promised"
import { ubuntuVersion } from "../utils/env/ubuntu_version" import { ubuntuVersion } from "../utils/env/ubuntu_version"
import { macosVersion } from "../utils/env/macos_version"
/** Get the platform data for cmake */ /** Get the platform data for cmake */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
@ -64,7 +65,10 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
} }
case "darwin": { case "darwin": {
const installationInfo = await setupBrewPack("doxygen", undefined) const installationInfo = await setupBrewPack("doxygen", undefined)
// only install graphviz if the macOS version is greater than 11
if (macosVersion()[0] > 11) {
await setupGraphviz(getVersion("graphviz", undefined), "", arch) await setupGraphviz(getVersion("graphviz", undefined), "", arch)
}
return installationInfo return installationInfo
} }
case "linux": { case "linux": {

13
src/utils/env/macos_version.ts vendored Normal file
View File

@ -0,0 +1,13 @@
import macosRelease from "macos-release"
import memoize from "micro-memoize"
/**
* Get macOS version
*
* @returns {number[]} - The macOS version as an array of numbers
*/
function macosVersion_raw() {
const { version } = macosRelease()
return version.split(".").map((v) => parseInt(v, 10))
}
export const macosVersion = memoize(macosVersion_raw)