0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-30 00:46:29 +01:00
svelte/test/parser/update.ts
2020-09-29 20:19:43 -04:00

14 lines
464 B
TypeScript

// this file will replace all the output.json files with their _actual.json
// equivalents. Only use it when you're sure that you haven't
// broken anything!
const fs = require('fs');
const glob = require('tiny-glob/sync.js');
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
);
});