|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
const sander = require('sander');
|
|
|
|
|
const glob = require('tiny-glob/sync');
|
|
|
|
|
|
|
|
|
|
process.chdir(__dirname);
|
|
|
|
|
|
|
|
|
@ -6,5 +7,14 @@ sander.readdirSync('samples').forEach(dir => {
|
|
|
|
|
if (dir[0] === '.') return;
|
|
|
|
|
|
|
|
|
|
sander.rimrafSync(`samples/${dir}/expected`);
|
|
|
|
|
sander.copydirSync(`samples/${dir}/actual`).to(`samples/${dir}/expected`);
|
|
|
|
|
|
|
|
|
|
const files = glob(`**`, { cwd: `samples/${dir}/actual`, filesOnly: true });
|
|
|
|
|
files.forEach(file => {
|
|
|
|
|
const source = sander.readFileSync(`samples/${dir}/actual/${file}`, { encoding: 'utf-8' });
|
|
|
|
|
|
|
|
|
|
sander.writeFileSync(
|
|
|
|
|
`samples/${dir}/expected/${file}`,
|
|
|
|
|
source.replace(/generated by Svelte v(\d+\.\d+\.\d+)/, 'generated by Svelte vx.y.z')
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|