(asset: EmbeddedAsset, targetPath: string)
| 17 | }).Bun; |
| 18 | |
| 19 | async function copyAssetFile(asset: EmbeddedAsset, targetPath: string): Promise<void> { |
| 20 | ensureDirectory(dirname(targetPath)); |
| 21 | if (bunRuntime) { |
| 22 | const data = await bunRuntime.file(asset.sourcePath).arrayBuffer(); |
| 23 | writeFileSync(targetPath, Buffer.from(data)); |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | copyFileSync(asset.sourcePath, targetPath); |
| 28 | try { |
| 29 | const stats = statSync(asset.sourcePath); |
| 30 | chmodSync(targetPath, stats.mode); |
| 31 | } catch { |
| 32 | // Best-effort; permission adjustments are not critical. |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | function getPlatformDir(): string { |
| 37 | const platformName = platform(); |
no test coverage detected