fix file read error in rewrite-local-links.js (#54871)
This commit is contained in:
@@ -47,6 +47,7 @@ function logError(file, line, message, title = 'Error') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getFrontmatterOffset(filePath) {
|
function getFrontmatterOffset(filePath) {
|
||||||
|
if (!fs.existsSync(filePath)) return 0
|
||||||
const rawContent = fs.readFileSync(filePath, 'utf-8')
|
const rawContent = fs.readFileSync(filePath, 'utf-8')
|
||||||
let delimiters = 0
|
let delimiters = 0
|
||||||
let count = 0
|
let count = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user