forked from pingcap/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refine ci of internal link checks (pingcap#9349) (pingcap#9354)
* refine cloud ci custom content auto rm * add tidb only check * fix error Co-authored-by: czhen <56986964+shczhen@users.noreply.github.com>
- Loading branch information
1 parent
e2a0bdd
commit f03746c
Showing
4 changed files
with
134 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { | ||
getFileList, | ||
copySingleFileSync, | ||
copyFileWithCustomContentSync, | ||
removeCustomContent, | ||
} from "./utils.js"; | ||
|
||
const contentHandler = (content = "") => { | ||
return removeCustomContent("tidb", content); | ||
}; | ||
|
||
const extractFilefromList = ( | ||
fileList = [], | ||
inputPath = ".", | ||
outputPath = "." | ||
) => { | ||
fileList.forEach((filePath = "") => { | ||
if ( | ||
filePath.includes(`/tidb-cloud/`) || | ||
filePath.includes(`TOC-tidb-cloud.md`) | ||
) { | ||
return; | ||
} | ||
if (filePath.endsWith(".md")) { | ||
copyFileWithCustomContentSync( | ||
`${inputPath}/${filePath}`, | ||
`${outputPath}/${filePath}`, | ||
contentHandler | ||
); | ||
} else { | ||
try { | ||
copySingleFileSync( | ||
`${inputPath}/${filePath}`, | ||
`${outputPath}/${filePath}` | ||
); | ||
} catch (error) {} | ||
} | ||
}); | ||
}; | ||
|
||
const main = () => { | ||
const filteredLinkList = getFileList("."); | ||
|
||
extractFilefromList(filteredLinkList, ".", "./tmp"); | ||
}; | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters