vendor: import codex-plugins as packages/omo-codex/{plugin,scripts,marketplace.json,MARKETPLACE.md}
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { spawn } from "node:child_process";
|
||||
|
||||
export async function defaultRunCommand(command, args, options) {
|
||||
await new Promise((resolvePromise, reject) => {
|
||||
const child = spawn(command, args, {
|
||||
cwd: options.cwd,
|
||||
stdio: "inherit",
|
||||
});
|
||||
child.once("error", reject);
|
||||
child.once("exit", (code, signal) => {
|
||||
if (code === 0) {
|
||||
resolvePromise();
|
||||
return;
|
||||
}
|
||||
const suffix = signal ? `signal ${signal}` : `exit code ${code}`;
|
||||
reject(new Error(`${command} ${args.join(" ")} failed in ${options.cwd} with ${suffix}`));
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user