runWithOutput = (cmd, args, opts = {}) =>
  new Promise(function (resolve, reject) {
    const stdouterrs = [];
    let exitCode;
    const child = spawn(cmd, args, {
      stdio: "pipe",
      ...opts,
    });
    child.stdout.on("data", (data) => {
      console.log(data.toString());
      stdouterrs.push(data.toString());
    });
    child.stderr.on("data", (data) => {
      console.error(data.toString());
      stdouterrs.push(data.toString());
    });
    child.on("exit", function (code, signal) {
      exitCode = code;
      resolve({ output: stdouterrs.join(""), exitCode });
    });
  })
@category saltcorn-cli
@module commands/post-release