mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
PR comments
This commit is contained in:
parent
b9aade2da4
commit
9cde77a408
4 changed files with 57 additions and 21 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue