16 lines
572 B
JavaScript
16 lines
572 B
JavaScript
import { mkdir, writeFile } from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { API_DOC_SYSTEM_CONFIG } from "./config.mjs";
|
|
|
|
async function clearPendingUpdates() {
|
|
const pendingFilePath = API_DOC_SYSTEM_CONFIG.file.pendingUpdates;
|
|
await mkdir(path.dirname(pendingFilePath), { recursive: true });
|
|
await writeFile(pendingFilePath, "{}\n", "utf8");
|
|
console.log(`已清空待更新接口文件: ${pendingFilePath}`);
|
|
}
|
|
|
|
clearPendingUpdates().catch((error) => {
|
|
console.error("清空待更新接口失败:", error.message);
|
|
process.exitCode = 1;
|
|
});
|