WEB/workflows/api-doc-system/core/clear-pending.mjs
2026-04-16 20:59:44 +08:00

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;
});