fix: cli file change detection now includes csv/yarn
This commit is contained in:
parent
b09560a4e5
commit
afe2eb4af8
|
|
@ -223,7 +223,7 @@ export function createContentServer(
|
|||
|
||||
watcher
|
||||
.on("add", (path) => {
|
||||
if (path.endsWith(".md")) {
|
||||
if (path.endsWith(".md") || path.endsWith(".csv") || path.endsWith(".yarn")) {
|
||||
try {
|
||||
const content = readFileSync(path, "utf-8");
|
||||
const relPath = "/" + relative(contentDir, path).split(sep).join("/");
|
||||
|
|
@ -235,7 +235,7 @@ export function createContentServer(
|
|||
}
|
||||
})
|
||||
.on("change", (path) => {
|
||||
if (path.endsWith(".md")) {
|
||||
if (path.endsWith(".md") || path.endsWith(".csv") || path.endsWith(".yarn")) {
|
||||
try {
|
||||
const content = readFileSync(path, "utf-8");
|
||||
const relPath = "/" + relative(contentDir, path).split(sep).join("/");
|
||||
|
|
@ -247,7 +247,7 @@ export function createContentServer(
|
|||
}
|
||||
})
|
||||
.on("unlink", (path) => {
|
||||
if (path.endsWith(".md")) {
|
||||
if (path.endsWith(".md") || path.endsWith(".csv") || path.endsWith(".yarn")) {
|
||||
const relPath = "/" + relative(contentDir, path).split(sep).join("/");
|
||||
delete contentIndex[relPath];
|
||||
console.log(`[删除] ${relPath}`);
|
||||
|
|
|
|||
Loading…
Reference in New Issue