MCPcopy
hub / github.com/electron/forge / getWorkspacePath

Function getWorkspacePath

packages/api/core/src/api/init-scripts/init-link.ts:40–60  ·  view source on GitHub ↗
(packageName: string)

Source from the content-addressed store, hash-verified

38 );
39
40 const getWorkspacePath = (packageName: string): string => {
41 const result = spawnSync(
42 'yarn',
43 ['workspace', packageName, 'exec', 'pwd'],
44 {
45 cwd: forgeRoot,
46 encoding: 'utf-8',
47 shell: process.platform === 'win32',
48 },
49 );
50
51 if (result.status !== 0) {
52 d(`Failed to get workspace path for ${packageName}: ${result.stderr}`);
53 throw new Error(
54 `Unable to determine workspace path for ${packageName}`,
55 );
56 }
57
58 const workspacePath = result.stdout.trim();
59 return workspacePath;
60 };
61
62 // Collect all @electron-forge packages and their workspace paths
63 const packagesToLink: Record<string, string> = {};

Callers 1

initLinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected