MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / resolveCliPath

Function resolveCliPath

packages/vscode-extension/extension.js:300–325  ·  view source on GitHub ↗
(context, configuredPath)

Source from the content-addressed store, hash-verified

298}
299
300function resolveCliPath(context, configuredPath) {
301 if (configuredPath) {
302 return configuredPath;
303 }
304
305 const workspaceFolders = vscode.workspace.workspaceFolders ?? [];
306 for (const folder of workspaceFolders) {
307 const candidate = path.join(folder.uri.fsPath, "build", "simdeck");
308 if (fs.existsSync(candidate)) {
309 return candidate;
310 }
311 }
312
313 const extensionWorkspaceCandidate = path.resolve(
314 context.extensionPath,
315 "..",
316 "..",
317 "build",
318 "simdeck",
319 );
320 if (fs.existsSync(extensionWorkspaceCandidate)) {
321 return extensionWorkspaceCandidate;
322 }
323
324 return "simdeck";
325}
326
327function resolveWorkingDirectory(context) {
328 const workspaceFolders = vscode.workspace.workspaceFolders ?? [];

Callers 2

startProjectServiceFunction · 0.85
stopProjectServiceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected