🎥 Make videos programmatically with React
is sem ver
Jonny Burgerce33ef12ef9c
diff --git a/packages/docs/docs/install-whisper-cpp/install-whisper-cpp.mdx b/packages/docs/docs/install-whisper-cpp/install-whisper-cpp.mdxindex e98ab75aa1..f81fef6e47 100644--- a/packages/docs/docs/install-whisper-cpp/install-whisper-cpp.mdx+++ b/packages/docs/docs/install-whisper-cpp/install-whisper-cpp.mdx@@ -17,7 +17,7 @@ import { installWhisperCpp } from "@remotion/install-whisper-cpp";const { alreadyExisted } = await installWhisperCpp({to: path.join(process.cwd(), "whisper.cpp"),- version: "48a145", //Whisper.cpp commit hash+ version: "48a145", // A Whisper.cpp commit hash or release tag});```@@ -40,8 +40,9 @@ The folder to install Whisper.cpp into.The version of Whisper.cpp to install. Don't include the `v` prefix.This can be either a hash of a Whisper.cpp commit or a semantic version of an official release.+:::info-On Windows, currently only official releases of Whisper.cpp are supported (E.g., 1.5.4).+On Windows, currently only release tags of Whisper.cpp are supported (e.g `1.5.4`).:::### `printOutput?`diff --git a/packages/install-whisper-cpp/src/install-whisper-cpp.ts b/packages/install-whisper-cpp/src/install-whisper-cpp.tsindex 8ff8119ac2..fdf0ab8422 100644--- a/packages/install-whisper-cpp/src/install-whisper-cpp.ts+++ b/packages/install-whisper-cpp/src/install-whisper-cpp.ts@@ -7,6 +7,10 @@ import type {ReadableStream} from 'node:stream/web';import os from 'os';import path from 'path';+const getIsSemVer = (str: string) => {+ return /^[\d]{1}\.[\d]{1,2}\.+/.test(str);+};+const installForWindows = async ({version,to,@@ -16,10 +20,8 @@ const installForWindows = async ({to: string;printOutput: boolean;}) => {- const isSemVer = /^[\d]{1}\.[\d]{1,2}\.+/;-- if (!isSemVer) {- throw new Error(`Non-semantic version provided. Only releases of Whisper.cpp are supportet (E.g., 1.5.4). Provided version:+ if (!getIsSemVer(version)) {+ throw new Error(`Non-semantic version provided. Only releases of Whisper.cpp are supported on Windows (e.g., 1.5.4). Provided version:${version}. See https://www.remotion.dev/docs/install-whisper-cpp/install-whisper-cpp#version for more information.`);}@@ -57,9 +59,7 @@ const installWhisperForUnix = ({stdio,});- const isSemVer = /^[\d]{1}\.[\d]{1,2}\.+/;-- const ref = isSemVer.test(version) ? `v${version}` : version;+ const ref = getIsSemVer(version) ? `v${version}` : version;execSync(`git checkout ${ref}`, {stdio,