(path: string)
| 68 | } |
| 69 | |
| 70 | function readFileSha256(path: string): string | null { |
| 71 | try { |
| 72 | return sha256(readFileSync(path)); |
| 73 | } catch { |
| 74 | return null; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | function ensureFile(path: string, bytes: Buffer, expectedSha256: string): void { |
| 79 | if (readFileSha256(path) === expectedSha256) return; |