mirror of
https://github.com/bakhirev/assayo.git
synced 2024-11-16 16:21:41 +00:00
18 lines
601 B
JavaScript
18 lines
601 B
JavaScript
|
const fs = require('node:fs');
|
||
|
|
||
|
const prefixes = [ './', '../', '../../', '/'];
|
||
|
const suffixes = (new Array(6)).fill(1).map((a, i) => i + 1);
|
||
|
const paths = [];
|
||
|
prefixes.forEach((prefix) => {
|
||
|
paths.push(`<script src='${prefix}log.txt'></script>`);
|
||
|
suffixes.forEach((suffix) => {
|
||
|
paths.push(`<script src='${prefix}log-${suffix}.txt'></script>`);
|
||
|
});
|
||
|
});
|
||
|
const content = paths.join('');
|
||
|
|
||
|
const html = fs.readFileSync('../build/index.html', 'utf8');
|
||
|
const text = html
|
||
|
.replace(/var\sreport=\[]<\/script>/gim, `var report=[]</script>${content}`);
|
||
|
fs.writeFileSync('../build/index.html', text);
|