import { log } from "../log.js"; import { commandExists, runPassthrough } from "../util.js"; import { getActiveTui } from "../runtime-config.js"; function brewInstallIfMissing(cmd: string, pkg?: string): void { if (commandExists(cmd)) { log(`${pkg ?? cmd} already installed.`); } else { log(`Installing ${pkg ?? cmd}...`); runPassthrough(`brew install ${pkg ?? cmd}`); } } export function installTools(): void { brewInstallIfMissing("jq"); brewInstallIfMissing("python3", "python@3.12"); brewInstallIfMissing("pipx"); const tui = getActiveTui(); if (!commandExists(tui.checkCmd)) { log(`Installing ${tui.name}...`); runPassthrough(tui.installCmd); } else { log(`${tui.name} already installed.`); } }