@remotion/install-whisper-cpp 4.0.171 → 4.0.173
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.
- package/dist/install-whisper-cpp.js +10 -7
- package/package.json +1 -1
|
@@ -35,10 +35,9 @@ const download_1 = require("./download");
|
|
|
35
35
|
const getIsSemVer = (str) => {
|
|
36
36
|
return /^[\d]{1}\.[\d]{1,2}\.+/.test(str);
|
|
37
37
|
};
|
|
38
|
-
const execute = ({
|
|
38
|
+
const execute = ({ printOutput, signal, cwd, shell, args, bin, }) => {
|
|
39
39
|
const stdio = printOutput ? 'inherit' : 'ignore';
|
|
40
40
|
return new Promise((resolve, reject) => {
|
|
41
|
-
const [bin, ...args] = command.split(' ');
|
|
42
41
|
const child = (0, child_process_1.spawn)(bin, args, {
|
|
43
42
|
stdio,
|
|
44
43
|
signal: signal !== null && signal !== void 0 ? signal : undefined,
|
|
@@ -47,7 +46,7 @@ const execute = ({ command, printOutput, signal, cwd, shell, }) => {
|
|
|
47
46
|
});
|
|
48
47
|
child.on('exit', (code, exitSignal) => {
|
|
49
48
|
if (code !== 0) {
|
|
50
|
-
reject(new Error(`Error while executing ${
|
|
49
|
+
reject(new Error(`Error while executing ${bin} ${args.join(' ')}. Exit code: ${code}, signal: ${exitSignal}`));
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
53
52
|
resolve();
|
|
@@ -72,17 +71,19 @@ const installForWindows = async ({ version, to, printOutput, signal, }) => {
|
|
|
72
71
|
signal,
|
|
73
72
|
});
|
|
74
73
|
await execute({
|
|
75
|
-
command: `Expand-Archive -Force ${filePath} ${to}`,
|
|
76
74
|
shell: 'powershell',
|
|
77
75
|
printOutput,
|
|
78
76
|
signal,
|
|
79
77
|
cwd: null,
|
|
78
|
+
bin: 'Expand-Archive',
|
|
79
|
+
args: ['-Force', filePath, to],
|
|
80
80
|
});
|
|
81
81
|
(0, fs_1.rmSync)(filePath);
|
|
82
82
|
};
|
|
83
83
|
const installWhisperForUnix = async ({ version, to, printOutput, signal, }) => {
|
|
84
84
|
await execute({
|
|
85
|
-
|
|
85
|
+
bin: 'git',
|
|
86
|
+
args: ['clone', 'https://github.com/ggerganov/whisper.cpp.git', to],
|
|
86
87
|
printOutput,
|
|
87
88
|
signal,
|
|
88
89
|
cwd: null,
|
|
@@ -90,14 +91,16 @@ const installWhisperForUnix = async ({ version, to, printOutput, signal, }) => {
|
|
|
90
91
|
});
|
|
91
92
|
const ref = getIsSemVer(version) ? `v${version}` : version;
|
|
92
93
|
await execute({
|
|
93
|
-
|
|
94
|
+
bin: 'git',
|
|
95
|
+
args: ['checkout', ref],
|
|
94
96
|
printOutput,
|
|
95
97
|
cwd: to,
|
|
96
98
|
signal,
|
|
97
99
|
shell: null,
|
|
98
100
|
});
|
|
99
101
|
await execute({
|
|
100
|
-
|
|
102
|
+
args: [],
|
|
103
|
+
bin: 'make',
|
|
101
104
|
cwd: to,
|
|
102
105
|
signal,
|
|
103
106
|
printOutput,
|