Skip to content

Commit 5187ff3

Browse files
committed
fix(ci): update file paths for correct resolution
1 parent 7dd56ce commit 5187ff3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.teamcity/scripts/fix-wrs/index.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { load } from 'cheerio';
22
import { readFile, writeFile } from 'node:fs/promises';
33
import { join, resolve } from 'node:path';
44

5-
const ROOT_DIR = resolve('.');
6-
const DATA_DIR = join(ROOT_DIR, 'kr.tree');
5+
6+
const ROOT_DIR = resolve('..', '..');
7+
const DATA_DIR = join(ROOT_DIR, 'docs/kr.tree');
78

89
const text = (await readFile(DATA_DIR));
910
const $ = await load(text, { xml: true });
@@ -13,7 +14,8 @@ const ids = (await $('toc-element[hidden="true"]'))
1314

1415
const dels = ids
1516
.map(async id => {
16-
const file = `${ROOT_DIR}/pages/${id.replace(/.md$/g, '.html')}`;
17+
const fileName = id.replace(/.md$/g, '').replace(/\./g, '-') + '.html';
18+
const file = `${ROOT_DIR}/pages/${fileName}`;
1719
const text = await readFile(file);
1820
const patched = text.toString().replace(/(<head>)/g, '$1<meta name="robots" content="noindex">');
1921
console.log('exclude', file);

0 commit comments

Comments
 (0)