(name)
| 19 | export const hash = text => createHash('sha256').update(text).digest('hex'); |
| 20 | |
| 21 | export function buildPath(name) { |
| 22 | if (!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(name)) { |
| 23 | throw new Error('Build names must contain only letters, numbers, hyphens, or underscores.'); |
| 24 | } |
| 25 | return path.join(local, 'builds', name); |
| 26 | } |
| 27 | |
| 28 | async function filesIn(dir) { |
| 29 | let entries = await fs.readdir(dir, {withFileTypes: true}); |