| 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> = {}; |