function exec(cmd) {
  if (!Array.isArray(cmd)) cmd = String(cmd).split(" ");
  const [bin, ...args] = cmd;
  return new Promise((resolve) => {
    const child = cp.spawn(bin, args, {
      shell: true,
      stdio: "inherit",
    });
    child.once("exit", () => {
      resolve(child.exitCode);
    });
  });
}
/**
 * Invoke the given command and return a Promise that resolves to its exit code.
 */
Invoke the given command and return a Promise that resolves to its exit code.
Invoke the given command and return a Promise that resolves to its exit code .
function exec(cmd) {
  if (!Array.isArray(cmd)) cmd = String(cmd).split(" ");
  const [bin, ...args] = cmd;
  return new Promise((resolve) => {
    const child = cp.spawn(bin, args, {
      shell: true,
      stdio: "inherit",
    });
    child.once("exit", () => {
      resolve(child.exitCode);
    });
  });
}
function exec ( cmd ) { if ( ! Array . isArray ( cmd ) ) cmd = String ( cmd ) . split ( " " ) ; const [ bin , ... args ] = cmd ; return new Promise ( ( resolve ) => { const child = cp . spawn ( bin , args , { shell : true , stdio : "inherit" , } ) ; child . once ( "exit" , ( ) => { resolve ( child . exitCode ) ; } ) ; } ) ; }
Invoke the given command and return a Promise that resolves to its exit code.
Invoke the given command and return a Promise that resolves to its exit code .