File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
.teamcity/scripts/fix-wrs Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ import { load } from 'cheerio';
2
2
import { readFile , writeFile } from 'node:fs/promises' ;
3
3
import { join , resolve } from 'node:path' ;
4
4
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' ) ;
7
8
8
9
const text = ( await readFile ( DATA_DIR ) ) ;
9
10
const $ = await load ( text , { xml : true } ) ;
@@ -13,7 +14,8 @@ const ids = (await $('toc-element[hidden="true"]'))
13
14
14
15
const dels = ids
15
16
. map ( async id => {
16
- const file = `${ ROOT_DIR } /pages/${ id . replace ( / .m d $ / g, '.html' ) } ` ;
17
+ const fileName = id . replace ( / .m d $ / g, '' ) . replace ( / \. / g, '-' ) + '.html' ;
18
+ const file = `${ ROOT_DIR } /pages/${ fileName } ` ;
17
19
const text = await readFile ( file ) ;
18
20
const patched = text . toString ( ) . replace ( / ( < h e a d > ) / g, '$1<meta name="robots" content="noindex">' ) ;
19
21
console . log ( 'exclude' , file ) ;
You can’t perform that action at this time.
0 commit comments