(context, dylibPath)
| 525 | } |
| 526 | |
| 527 | async function sendTcpReloadPath(context, dylibPath) { |
| 528 | const containerPath = appContainerPath(context); |
| 529 | const documentsDir = path.join(containerPath, "Documents"); |
| 530 | fs.mkdirSync(documentsDir, { recursive: true }); |
| 531 | const installedDylibPath = path.join(documentsDir, path.basename(dylibPath)); |
| 532 | fs.copyFileSync(dylibPath, installedDylibPath); |
| 533 | for (let offset = 0; offset < RELOAD_PORT_LIMIT; offset += 1) { |
| 534 | const port = RELOAD_PORT_START + offset; |
| 535 | if (await sendTcpReloadToPort(port, installedDylibPath)) { |
| 536 | return true; |
| 537 | } |
| 538 | } |
| 539 | return false; |
| 540 | } |
| 541 | |
| 542 | async function sendTcpReloadBytes(dylibPath) { |
| 543 | const base64 = fs.readFileSync(dylibPath).toString("base64"); |
no test coverage detected