Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS version check robustness. #99

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions install.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const get = require("simple-get");
const tar = require("tar");

const DOWNLOAD_RETRY_ATTEMPTS = 2;
const MACOS_MINIMUM_SUPPORTED_VERSION = 23;
const MACOS_MINIMUM_SUPPORTED_RELEASE = "Sonoma";

function targetFfmpegRelease() {

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

// Ensure we don't support versions of macOS that are too old.
if(os.platform() === "darwin" && parseInt(os.release()) < 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.");

process.exit(0);
}

// Determine the download file name for the current platform.
const ffmpegDownloadFileName = await getDownloadFileName();

if(!ffmpegDownloadFileName) {

if(os.platform() === "darwin" && parseInt(os.release()) < 24) {

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.");
} else {

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);
}
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);

process.exit(0);
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffmpeg-for-homebridge",
"version": "2.1.5",
"version": "2.1.6",
"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",
Expand Down