(dir, filename)
| 52 | } |
| 53 | |
| 54 | function findFile(dir, filename) { |
| 55 | const entries = fs.readdirSync(dir, { withFileTypes: true }); |
| 56 | for (const entry of entries) { |
| 57 | const fullPath = path.join(dir, entry.name); |
| 58 | if (entry.isFile() && entry.name === filename) { |
| 59 | return fullPath; |
| 60 | } |
| 61 | if (entry.isDirectory()) { |
| 62 | const found = findFile(fullPath, filename); |
| 63 | if (found) { |
| 64 | return found; |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | return null; |
| 69 | } |
| 70 | |
| 71 | const { platform, arch } = parseTarget(process.argv[2]); |
| 72 | const hostPlatform = os.platform(); |