Skip to content

Commit 0e51b44

Browse files
authored
macOS version check robustness. (#99)
1 parent 21e9549 commit 0e51b44

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

install.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const get = require("simple-get");
1010
const tar = require("tar");
1111

1212
const DOWNLOAD_RETRY_ATTEMPTS = 2;
13+
const MACOS_MINIMUM_SUPPORTED_VERSION = 23;
14+
const MACOS_MINIMUM_SUPPORTED_RELEASE = "Sonoma";
1315

1416
function targetFfmpegRelease() {
1517

@@ -222,18 +224,20 @@ async function install() {
222224
// Ensure the FFmpeg npm cache directory exists.
223225
ensureFfmpegCacheDir();
224226

227+
// Ensure we don't support versions of macOS that are too old.
228+
if(os.platform() === "darwin" && parseInt(os.release()) < MACOS_MINIMUM_SUPPORTED_VERSION) {
229+
230+
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.");
231+
232+
process.exit(0);
233+
}
234+
225235
// Determine the download file name for the current platform.
226236
const ffmpegDownloadFileName = await getDownloadFileName();
227237

228238
if(!ffmpegDownloadFileName) {
229239

230-
if(os.platform() === "darwin" && parseInt(os.release()) < 24) {
231-
232-
console.log("ffmpeg-for-homebridge: macOS versions older than 15 (Sequoia) are not supported, you will need to install a working version of FFmpeg manually.");
233-
} else {
234-
235-
console.log("ffmpeg-for-homebridge: %s %s is not supported, you will need to install a working version of FFmpeg manually.", os.platform, process.arch);
236-
}
240+
console.error("ffmpeg-for-homebridge: %s %s is not supported, you will need to install a working version of FFmpeg manually.", os.platform, process.arch);
237241

238242
process.exit(0);
239243
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ffmpeg-for-homebridge",
3-
"version": "2.1.5",
3+
"version": "2.1.6",
44
"description": "Static FFmpeg binaries for Homebridge with support for audio (libfdk-aac) and hardware encoding (h264_v4l2m2m and h264_qsv).",
55
"author": {
66
"name": "The Homebridge Team",

0 commit comments

Comments
 (0)