(run)
| 10 | const { classifyHookProblem, collectDashboard, percentile, readOperatorArtifacts, renderDashboard, relativeTime } = require('./dashboard'); |
| 11 | |
| 12 | function withTempProject(run) { |
| 13 | const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'citadel-dashboard-')); |
| 14 | try { |
| 15 | return run(dir); |
| 16 | } finally { |
| 17 | fs.rmSync(dir, { recursive: true, force: true }); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | function write(filePath, content) { |
| 22 | fs.mkdirSync(path.dirname(filePath), { recursive: true }); |