Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/command/tools/cmd.ts
3584 views
1
/*
2
* cmd.ts
3
*
4
* Copyright (C) 2020-2022 Posit Software, PBC
5
*/
6
7
import { Command } from "cliffy/command/mod.ts";
8
import {
9
outputTools,
10
removeTool,
11
updateOrInstallTool,
12
} from "../../tools/tools-console.ts";
13
import { printToolInfo } from "../../tools/tools.ts";
14
import { info } from "../../deno_ral/log.ts";
15
16
// The quarto install command
17
export const toolsCommand = new Command()
18
.name("tools")
19
.description(
20
`Display the status of Quarto installed dependencies`,
21
)
22
.example(
23
"Show tool status",
24
"quarto tools",
25
)
26
// deno-lint-ignore no-explicit-any
27
.action(async (_options: any) => {
28
await outputTools();
29
})
30
.command("install <tool:string>").hidden().action(
31
async (_options: any, tool: string) => {
32
info(
33
"This command has been superseded. Please use `quarto install` instead.\n",
34
);
35
await updateOrInstallTool(
36
tool,
37
"install",
38
);
39
},
40
)
41
.command("info <tool:string>").hidden().action(
42
async (_options: any, tool: string) => {
43
await printToolInfo(tool);
44
},
45
)
46
.command("uninstall <tool:string>").hidden().action(
47
async (_options: any, tool: string) => {
48
info(
49
"This command has been superseded. Please use `quarto uninstall` instead.\n",
50
);
51
await removeTool(tool);
52
},
53
)
54
.command("update <tool:string>").hidden().action(
55
async (_options: any, tool: string) => {
56
info(
57
"This command has been superseded. Please use `quarto update` instead.\n",
58
);
59
await updateOrInstallTool(
60
tool,
61
"update",
62
);
63
},
64
)
65
.command("list").hidden().action(async () => {
66
info(
67
"This command has been superseded. Please use `quarto tools` with no arguments to list tools and status.\n",
68
);
69
await outputTools();
70
});
71
72