File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { writeFile } from "node:fs/promises";
33import { join } from "node:path" ;
44import { ParsedMetadata } from "./types" ;
55import { sanitizeUrlAsFilename } from "../helpers/url-handling" ;
6+ import { BASE_HOST_TOKEN } from "../main" ;
67
78const FILENAME_LENGTH_THRESHOLD = 250 ;
89
@@ -14,9 +15,12 @@ export async function persistSnapshot(
1415 snapshot : ParsedMetadata ,
1516 outputDirectory : string ,
1617) : Promise < void > {
17- const finalName = sanitizeUrlAsFilename ( snapshot . url , {
18+ let finalName = sanitizeUrlAsFilename ( snapshot . url , {
1819 lengthThreshold : FILENAME_LENGTH_THRESHOLD ,
1920 } ) ;
21+ if ( finalName === BASE_HOST_TOKEN ) {
22+ finalName = "index" ;
23+ }
2024 await saveMetadata ( outputDirectory , `${ finalName } .json` , snapshot ) ;
2125}
2226
You can’t perform that action at this time.
0 commit comments