(path: string)
| 171 | } |
| 172 | |
| 173 | function readFileSha256(path: string): string | null { |
| 174 | try { |
| 175 | return sha256(readFileSync(path)); |
| 176 | } catch { |
| 177 | return null; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | function ensureFile(path: string, bytes: Buffer, expectedSha256: string, mode?: number): void { |
| 182 | if (readFileSha256(path) === expectedSha256) return; |