mirror of
https://github.com/morluto/rea.git
synced 2026-11-29 09:56:23 +00:00
22 lines
553 B
JavaScript
22 lines
553 B
JavaScript
/**
|
|
* Read the version recorded in a client verification receipt.
|
|
* @param {import("../../lib/verify-commands.mjs").VerifierCommands} commands
|
|
* @param {string} command
|
|
* @param {NodeJS.ProcessEnv} env
|
|
* @param {{args?: readonly string[], cwd?: string}} options
|
|
*/
|
|
export const readClientVersion = async (
|
|
commands,
|
|
command,
|
|
env,
|
|
{ args = ["--version"], ...options } = {},
|
|
) => {
|
|
const result = await commands.exec(command, args, {
|
|
env,
|
|
...options,
|
|
timeout: 30_000,
|
|
stdin: "pipe",
|
|
});
|
|
return result.stdout.trim();
|
|
};
|