MCPcopy
hub / github.com/di-sukharev/opencommit / execaSync

Function execaSync

out/cli.cjs:66947–67002  ·  view source on GitHub ↗
(file, args, options)

Source from the content-addressed store, hash-verified

66945 };
66946 const handlePromiseOnce = onetime_default(handlePromise);
66947 handleInput(spawned, parsed.options);
66948 spawned.all = makeAllStream(spawned, parsed.options);
66949 addPipeMethods(spawned);
66950 mergePromise(spawned, handlePromiseOnce);
66951 return spawned;
66952}
66953function execaSync(file, args, options) {
66954 const parsed = handleArguments(file, args, options);
66955 const command = joinCommand(file, args);
66956 const escapedCommand = getEscapedCommand(file, args);
66957 logCommand(escapedCommand, parsed.options);
66958 const input = handleInputSync(parsed.options);
66959 let result;
66960 try {
66961 result = import_node_child_process3.default.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
66962 } catch (error) {
66963 throw makeError({
66964 error,
66965 stdout: "",
66966 stderr: "",
66967 all: "",
66968 command,
66969 escapedCommand,
66970 parsed,
66971 timedOut: false,
66972 isCanceled: false,
66973 killed: false
66974 });
66975 }
66976 const stdout = handleOutput(parsed.options, result.stdout, result.error);
66977 const stderr2 = handleOutput(parsed.options, result.stderr, result.error);
66978 if (result.error || result.status !== 0 || result.signal !== null) {
66979 const error = makeError({
66980 stdout,
66981 stderr: stderr2,
66982 error: result.error,
66983 signal: result.signal,
66984 exitCode: result.status,
66985 command,
66986 escapedCommand,
66987 parsed,
66988 timedOut: result.error && result.error.code === "ETIMEDOUT",
66989 isCanceled: false,
66990 killed: result.signal !== null
66991 });
66992 if (!parsed.options.reject) {
66993 return error;
66994 }
66995 throw error;
66996 }
66997 return {
66998 command,
66999 escapedCommand,
67000 exitCode: 0,
67001 stdout,
67002 stderr: stderr2,
67003 failed: false,
67004 timedOut: false,

Callers 1

create$Function · 0.85

Calls 7

handleArgumentsFunction · 0.85
joinCommandFunction · 0.85
getEscapedCommandFunction · 0.85
logCommandFunction · 0.85
handleInputSyncFunction · 0.85
makeErrorFunction · 0.85
handleOutputFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…