@remotion/install-whisper-cpp 4.0.136 → 4.0.137

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,14 @@ const node_stream_1 = require("node:stream");
33
33
  const promises_1 = require("node:stream/promises");
34
34
  const os_1 = __importDefault(require("os"));
35
35
  const path_1 = __importDefault(require("path"));
36
+ const getIsSemVer = (str) => {
37
+ return /^[\d]{1}\.[\d]{1,2}\.+/.test(str);
38
+ };
36
39
  const installForWindows = async ({ version, to, printOutput, }) => {
40
+ if (!getIsSemVer(version)) {
41
+ throw new Error(`Non-semantic version provided. Only releases of Whisper.cpp are supported on Windows (e.g., 1.5.4). Provided version:
42
+ ${version}. See https://www.remotion.dev/docs/install-whisper-cpp/install-whisper-cpp#version for more information.`);
43
+ }
37
44
  const url = `https://github.com/ggerganov/whisper.cpp/releases/download/v${version}/whisper-bin-x64.zip`;
38
45
  const filePath = path_1.default.join(process.cwd(), 'whisper-bin-x64.zip');
39
46
  const fileStream = fs_1.default.createWriteStream(filePath);
@@ -53,8 +60,7 @@ const installWhisperForUnix = ({ version, to, printOutput, }) => {
53
60
  (0, node_child_process_1.execSync)(`git clone https://github.com/ggerganov/whisper.cpp.git ${to}`, {
54
61
  stdio,
55
62
  });
56
- const isSemVer = /^[\d]{1}\.[\d]{1,2}\.+/;
57
- const ref = isSemVer.test(version) ? `v${version}` : version;
63
+ const ref = getIsSemVer(version) ? `v${version}` : version;
58
64
  (0, node_child_process_1.execSync)(`git checkout ${ref}`, {
59
65
  stdio,
60
66
  cwd: to,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/install-whisper-cpp",
3
- "version": "4.0.136",
3
+ "version": "4.0.137",
4
4
  "description": "Install helper for Whisper.cpp",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,