MCPcopy Create free account
hub / github.com/buxuku/VideoSubtitleGenerator / runCommand

Function runCommand

utils.js:54–74  ·  view source on GitHub ↗
(command, args)

Source from the content-addressed store, hash-verified

52};
53
54function runCommand(command, args) {
55 return new Promise((resolve, reject) => {
56 const child = spawn(command, args);
57
58 child.stdout.on('data', (data) => {
59 console.log(`${data}`);
60 });
61
62 child.stderr.on('data', (data) => {
63 console.error(`${data}`);
64 });
65
66 child.on('close', (code) => {
67 if (code !== 0) {
68 reject(new Error(`${command} ${args.join(' ')} 进程退出,退出码 ${code}`));
69 } else {
70 resolve();
71 }
72 });
73 });
74}
75
76export const isDarwin = () => os.platform() === 'darwin';
77

Callers 1

installWhisperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected