Skip to content

Commit 4a25207

Browse files
cdervclaude
andcommitted
Fix quarto tools not listing chrome-headless-shell
`outputTools()` passed the display name (e.g. "Chrome Headless Shell") to `toolSummary()`, which lowercases to "chrome headless shell" — not the registry key "chrome-headless-shell". The lookup silently failed and the tool was skipped. Carry the registry key through `ToolInfo` by having `loadTools()` iterate `installableTools()` keys directly. Use `tool.key` for `toolSummary()` lookups, table display, and `selectTool()` values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5a76ee8 commit 4a25207

1 file changed

Lines changed: 14 additions & 29 deletions

File tree

src/tools/tools-console.ts

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { Table } from "cliffy/table/mod.ts";
99
import { info, warning } from "../deno_ral/log.ts";
1010

1111
import {
12-
allTools,
12+
installableTool,
13+
installableTools,
1314
installTool,
1415
toolSummary,
1516
uninstallTool,
@@ -24,6 +25,7 @@ import {
2425
} from "../tools/types.ts";
2526

2627
interface ToolInfo {
28+
key: string;
2729
tool: InstallableTool;
2830
installed: boolean;
2931
version?: string;
@@ -51,18 +53,16 @@ export async function outputTools() {
5153
}
5254
};
5355

54-
// The column widths for output (in chars)
5556
const tools = await loadTools();
5657
for (const tool of tools) {
57-
const summary = await toolSummary(tool.tool.name);
58+
const summary = await toolSummary(tool.key);
5859
if (summary) {
59-
const toolDetails = [
60-
tool.tool.name.toLowerCase(),
60+
toolRows.push([
61+
tool.key,
6162
installStatus(summary),
6263
summary.installedVersion || "---",
6364
summary.latestRelease.version,
64-
];
65-
toolRows.push(toolDetails);
65+
]);
6666

6767
if (summary.configuration.status !== "ok") {
6868
statusMsgs.push(
@@ -73,7 +73,6 @@ export async function outputTools() {
7373
}
7474

7575
info("");
76-
// Write the output
7776
const table = new Table().header([
7877
colors.bold("Tool"),
7978
colors.bold("Status"),
@@ -91,27 +90,13 @@ export async function outputTools() {
9190
export async function loadTools(): Promise<ToolInfo[]> {
9291
let sorted: ToolInfo[] = [];
9392
await withSpinner({ message: "Inspecting tools" }, async () => {
94-
const all = await allTools();
95-
const toolsWithInstall = [{
96-
tools: all.installed,
97-
installed: true,
98-
}, {
99-
tools: all.notInstalled,
100-
installed: false,
101-
}];
102-
10393
const toolInfos = [];
104-
for (const toolWithInstall of toolsWithInstall) {
105-
for (const tool of toolWithInstall.tools) {
106-
const version = await tool.installedVersion();
107-
const latest = await tool.latestRelease();
108-
toolInfos.push({
109-
tool,
110-
version,
111-
installed: toolWithInstall.installed,
112-
latest,
113-
});
114-
}
94+
for (const key of installableTools()) {
95+
const tool = installableTool(key);
96+
const installed = await tool.installed();
97+
const version = await tool.installedVersion();
98+
const latest = await tool.latestRelease();
99+
toolInfos.push({ key, tool, version, installed, latest });
115100
}
116101

117102
sorted = toolInfos.sort((tool1, tool2) => {
@@ -243,7 +228,7 @@ export async function selectTool(
243228
options: toolsInfo.map((toolInfo) => {
244229
return {
245230
name: name(toolInfo),
246-
value: toolInfo.tool.name.toLowerCase(),
231+
value: toolInfo.key,
247232
disabled: action === "install"
248233
? toolInfo.installed
249234
: !toolInfo.installed,

0 commit comments

Comments
 (0)