INNER CODE UNIT · TypeScript
checkTools
1095071913/maozi-cloud · maozi-cloud-develop-admin/electron/configs/index.ts:41
async function checkTools(): Promise<ToolAvailability> {
const [git, docker, helm, linux] = await Promise.all([
toolExists('Git'),
toolExists('Docker'),
toolExists('Helm'),
toolExists('Linux')
])
return { git, docker, helm, linux }
}
/** 执行命令并向 stdin 写入密码(避免出现在进程参数中) */
function execWithStdin(cmd: string, args: string[], input: string, timeoutMs = 30_000): Promise<string> {
return new Promise((resolve, reject) => {
void (async () => {
const pathEnv = await getShellPath()
const child = spawn(cmd, args, { env: { ...process.env, PATH: pathEnv } })
let out = ''
let err = ''