From 2926ff4aa6b97131dd3670947033826e2565c5cd Mon Sep 17 00:00:00 2001 From: HJD Date: Sun, 20 Oct 2024 12:01:44 -0500 Subject: [PATCH] Fix: correct macOS version checks. --- install.js | 19 ++++++++----------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/install.js b/install.js index b7a752a..196b7ea 100755 --- a/install.js +++ b/install.js @@ -42,21 +42,18 @@ async function getDownloadFileName() { case "darwin": - if(parseInt(os.release()) >= 24) { - - switch(process.arch) { + switch(process.arch) { - case "x64": + case "x64": - return "ffmpeg-darwin-x86_64.tar.gz"; + return "ffmpeg-darwin-x86_64.tar.gz"; - case "arm64": + case "arm64": - return "ffmpeg-darwin-arm64.tar.gz"; + return "ffmpeg-darwin-arm64.tar.gz"; - default: - return null; - } + default: + return null; } case "linux": @@ -225,7 +222,7 @@ async function install() { ensureFfmpegCacheDir(); // Ensure we don't support versions of macOS that are too old. - if(os.platform() === "darwin" && parseInt(os.release()) < MACOS_MINIMUM_SUPPORTED_VERSION) { + if((os.platform().toString() === "darwin") && (parseInt(os.release().split(".")[0]) < MACOS_MINIMUM_SUPPORTED_VERSION)) { console.error("ffmpeg-for-homebridge: macOS versions older than " + MACOS_MINIMUM_SUPPORTED_RELEASE + " are not supported, you will need to install a working version of FFmpeg manually."); diff --git a/package-lock.json b/package-lock.json index c764905..852bdc8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ffmpeg-for-homebridge", - "version": "2.1.6", + "version": "2.1.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ffmpeg-for-homebridge", - "version": "2.1.6", + "version": "2.1.7", "hasInstallScript": true, "dependencies": { "dotenv": "^16.4.5", diff --git a/package.json b/package.json index dc88dd5..f21cf27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ffmpeg-for-homebridge", - "version": "2.1.6", + "version": "2.1.7", "description": "Static FFmpeg binaries for Homebridge with support for audio (libfdk-aac) and hardware encoding (h264_v4l2m2m and h264_qsv).", "author": { "name": "The Homebridge Team",