MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / installExtension

Function installExtension

src/test/standardTest.node.ts:107–128  ·  view source on GitHub ↗
(extension: string, cliPath: string, extensionsDir: string, args: string[] = [])

Source from the content-addressed store, hash-verified

105
106// Make sure renderers is there too as we'll use it for widget tests
107async function installExtension(extension: string, cliPath: string, extensionsDir: string, args: string[] = []) {
108 args = ['--install-extension', extension, ...args, '--extensions-dir', extensionsDir, '--disable-telemetry'];
109 const output =
110 process.platform === 'win32'
111 ? spawnSync(cliPath, args, {
112 encoding: 'utf-8',
113 stdio: 'inherit',
114 shell: true // Without this, node 20 would fail to install the extensions on Windows. See https://github.com/nodejs/node/issues/52554
115 })
116 : spawnSync(cliPath, args, {
117 encoding: 'utf-8',
118 stdio: 'inherit'
119 });
120
121 if (output.error) {
122 throw output.error;
123 }
124 if (output.stderr) {
125 console.error(`Error installing ${extension} Extension to ${extensionsDir}`);
126 console.error(output.stderr);
127 }
128}
129
130async function createSettings(): Promise<string> {
131 // User data dir can be overridden with an environment variable.

Callers 1

installPythonExtensionFunction · 0.85

Calls 1

errorMethod · 0.65

Tested by

no test coverage detected