chore: fix broken script for generating parser tests (#8945)

---------

Co-authored-by: gtmnayan <50981692+gtm-nayan@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
pull/8951/head
Ben McCann 1 year ago committed by GitHub
parent 8601195a85
commit ff7a4c07d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,8 +2,12 @@
// equivalents. Only use it when you're sure that you haven't
// broken anything!
import * as fs from 'node:fs';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import glob from 'tiny-glob/sync.js';
const __dirname = dirname(fileURLToPath(import.meta.url));
glob('samples/*/_actual.json', { cwd: __dirname }).forEach((file) => {
const actual = fs.readFileSync(`${__dirname}/${file}`, 'utf-8');
fs.writeFileSync(`${__dirname}/${file.replace('_actual.json', 'output.json')}`, actual);

Loading…
Cancel
Save