mirror of
https://github.com/bakhirev/assayo.git
synced 2024-11-16 08:11:40 +00:00
17 lines
568 B
JavaScript
17 lines
568 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(/<\/title>/gim, `</title>${content}`);
|
|
fs.writeFileSync('../build/index.html', text);
|