mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 23:00:03 +00:00
fix(cli): discover project-local ffmpeg binaries (#2464)
* fix(cli): discover project-local ffmpeg binaries * style(cli): format project-local ffmpeg discovery * style(media-use): format resolver script * chore(skills): refresh bundled manifest
This commit is contained in:
@@ -87,13 +87,21 @@ function findInCommonDirs(name: "ffmpeg" | "ffprobe"): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function findInProjectLocalBin(name: "ffmpeg" | "ffprobe"): string | undefined {
|
||||
const extension = process.platform === "win32" ? ".exe" : "";
|
||||
const candidate = resolve(".hyperframes", "bin", `${name}${extension}`);
|
||||
return existsSync(candidate) ? candidate : undefined;
|
||||
}
|
||||
|
||||
function findConfiguredBinary(
|
||||
envName: string,
|
||||
binaryName: "ffmpeg" | "ffprobe",
|
||||
): string | undefined {
|
||||
const configured = process.env[envName]?.trim();
|
||||
if (configured) return existsSync(configured) ? resolve(configured) : undefined;
|
||||
return findOnPath(binaryName) ?? findInCommonDirs(binaryName);
|
||||
return (
|
||||
findOnPath(binaryName) ?? findInProjectLocalBin(binaryName) ?? findInCommonDirs(binaryName)
|
||||
);
|
||||
}
|
||||
|
||||
export function findFFmpeg(): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user