(dir, base = dir)
| 46 | } |
| 47 | |
| 48 | function walk(dir, base = dir) { |
| 49 | const out = [] |
| 50 | for (const name of readdirSync(dir)) { |
| 51 | const full = join(dir, name) |
| 52 | if (statSync(full).isDirectory()) out.push(...walk(full, base)) |
| 53 | else out.push(relative(base, full)) |
| 54 | } |
| 55 | return out |
| 56 | } |
| 57 | |
| 58 | function hashFile(path) { |
| 59 | return createHash('sha256').update(readFileSync(path)).digest('hex') |