(value)
| 329 | } |
| 330 | |
| 331 | function normalizeDevEcoRoot(value) { |
| 332 | const resolved = path.resolve(value); |
| 333 | const basename = path.basename(resolved); |
| 334 | |
| 335 | if (basename === 'sdk') { |
| 336 | return path.dirname(resolved); |
| 337 | } |
| 338 | |
| 339 | if (basename === 'Contents') { |
| 340 | return resolved; |
| 341 | } |
| 342 | |
| 343 | if (resolved.endsWith('.app')) { |
| 344 | return path.join(resolved, 'Contents'); |
| 345 | } |
| 346 | |
| 347 | if (fs.existsSync(path.join(resolved, 'Contents', 'tools'))) { |
| 348 | return path.join(resolved, 'Contents'); |
| 349 | } |
| 350 | |
| 351 | return resolved; |
| 352 | } |
| 353 | |
| 354 | function resolveBinary(name, candidates) { |
| 355 | const explicitPath = findExistingPath(candidates); |
no test coverage detected