Skip to content

🎥 Make videos programmatically with React

prefix `v` only if it looks like a version number

Jonny Burger945181b9c825
diff --git a/packages/install-whisper-cpp/src/install-whisper-cpp.ts b/packages/install-whisper-cpp/src/install-whisper-cpp.ts
index e507e08fe8..8c108058a7 100644
--- a/packages/install-whisper-cpp/src/install-whisper-cpp.ts
+++ b/packages/install-whisper-cpp/src/install-whisper-cpp.ts
@@ -49,7 +49,11 @@ const installWhisperForUnix = ({
stdio,
});
- execSync(`git checkout v${version}`, {
+ const isSemVer = /^[\d]{1}\.[\d]{1,2}\.+/;
+
+ const ref = isSemVer.test(version) ? `v${version}` : version;
+
+ execSync(`git checkout v${ref}`, {
stdio,
cwd: to,
});