PR comments

This commit is contained in:
Sander Declerck 2026-01-22 08:20:45 +01:00
parent b9aade2da4
commit 9cde77a408
No known key found for this signature in database
4 changed files with 57 additions and 21 deletions

View file

@ -1,5 +1,6 @@
import { spawn, execSync } from "child_process";
import os from "os";
import { ui } from "../environment/userInteraction.js";
/**
* @param {string} arg
@ -135,3 +136,18 @@ export async function safeSpawn(command, args, options = {}) {
});
});
}
/**
* @param {string} command
* @param {string[]} args
* @param {import("child_process").SpawnOptions} options
*
* @returns {Promise<{status: number, stdout: string, stderr: string}>}
*/
export async function printVerboseAndSafeSpawn(command, args, options = {}) {
ui.writeVerbose(`Running: ${command} ${args.join(" ")}`);
const result = await safeSpawn(command, args, options);
return result;
}