(targets: InstallTargets)
| 257 | } |
| 258 | |
| 259 | export function getTargetDirs(targets: InstallTargets): string[] { |
| 260 | const hasUniversal = targets.ides.some((ide) => ide === "universal"); |
| 261 | const dirs: string[] = []; |
| 262 | |
| 263 | for (const scope of targets.scopes) { |
| 264 | const baseDir = scope === "global" ? homedir() : process.cwd(); |
| 265 | |
| 266 | if (hasUniversal) { |
| 267 | const uniPath = scope === "global" ? UNIVERSAL_SKILLS_GLOBAL_PATH : UNIVERSAL_SKILLS_PATH; |
| 268 | dirs.push(join(baseDir, uniPath)); |
| 269 | } |
| 270 | |
| 271 | for (const ide of targets.ides) { |
| 272 | if (ide === "universal") continue; |
| 273 | const pathMap = scope === "global" ? IDE_GLOBAL_PATHS : IDE_PATHS; |
| 274 | dirs.push(join(baseDir, pathMap[ide])); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | return dirs; |
| 279 | } |
| 280 | |
| 281 | export function getTargetDirFromSelection(ide: IDE, scope: Scope): string { |
| 282 | if (ide === "universal") { |
no outgoing calls
no test coverage detected