| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,6 +95,8 @@ class ReportResult { | |||
| 95 | 95 | class WPTReport { | |
| 96 | 96 | constructor(path) { | |
| 97 | 97 | this.filename = `report-${path.replaceAll('/', '-')}.json`; | |
| 98 | + // Resolve at construction time so cwd changes (e.g. tmpdir cleanup) don't affect the output path. | ||
| 99 | + this.filepath = path.resolve('out', 'wpt', this.filename); | ||
| 98 | 100 | /** @type {Map<string, ReportResult>} */ | |
| 99 | 101 | this.results = new Map(); | |
| 100 | 102 | this.time_start = Date.now(); | |
@@ -139,7 +141,7 @@ class WPTReport { | |||
| 139 | 141 | os: getOs(), | |
| 140 | 142 | }; | |
| 141 | 143 | ||
| 142 | - fs.writeFileSync(`out/wpt/${this.filename}`, JSON.stringify({ | ||
| 144 | + fs.writeFileSync(this.filepath, JSON.stringify({ | ||
| 143 | 145 | time_start: this.time_start, | |
| 144 | 146 | time_end: this.time_end, | |
| 145 | 147 | run_info: this.run_info, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments