MCPcopy Create free account
hub / github.com/arctic-cli/interface / install

Function install

packages/arctic/src/ide/index.ts:76–100  ·  view source on GitHub ↗
(ide: (typeof SUPPORTED_IDES)[number]["name"])

Source from the content-addressed store, hash-verified

74 }
75
76 export async function install(ide: (typeof SUPPORTED_IDES)[number]["name"]) {
77 const cmd = SUPPORTED_IDES.find((i) => i.name === ide)?.cmd
78 if (!cmd) throw new Error(`Unknown IDE: ${ide}`)
79
80 const p = spawn([cmd, "--install-extension", "sst-dev.arctic"], {
81 stdout: "pipe",
82 stderr: "pipe",
83 })
84 await p.exited
85 const stdout = await new Response(p.stdout).text()
86 const stderr = await new Response(p.stderr).text()
87
88 log.info("installed", {
89 ide,
90 stdout,
91 stderr,
92 })
93
94 if (p.exitCode !== 0) {
95 throw new InstallFailedError({ stderr })
96 }
97 if (stdout.includes("already installed")) {
98 throw new AlreadyInstalledError({})
99 }
100 }
101}

Callers

nothing calls this directly

Calls 2

spawnFunction · 0.85
textMethod · 0.65

Tested by

no test coverage detected