pug-site-core 3.0.23 → 3.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/generate.js +8 -2
  2. package/package.json +2 -2
package/lib/generate.js CHANGED
@@ -214,6 +214,12 @@ export async function fetchDataToJsonFile(args) {
214
214
 
215
215
  let saveJsonData = async (filePath, data) => {
216
216
  let finalPath = paths.resolveRoot("jsonData", filePath);
217
+
218
+ // 如果 路径存在,跳过写入
219
+ if (args.includes("skip") && await fse.pathExists(finalPath)) {
220
+ return;
221
+ }
222
+
217
223
  await fse.remove(finalPath);
218
224
  await fse.outputJson(finalPath, data);
219
225
  };
@@ -249,8 +255,8 @@ export async function fetchDataToJsonFile(args) {
249
255
  return Promise.resolve();
250
256
  };
251
257
 
252
- // 如果没有过滤条件,清空输出目录
253
- if (!filterFun.length && !filterLang.length) {
258
+ // 如果没有过滤条件且不是skip模式,清空输出目录
259
+ if (!filterFun.length && !filterLang.length && !args.includes("skip")) {
254
260
  await fse.remove(paths.resolveRoot("jsonData"));
255
261
  }
256
262
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pug-site-core",
3
- "version": "3.0.23",
3
+ "version": "3.0.25",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -52,7 +52,7 @@
52
52
  "ws": "^8.18.0"
53
53
  },
54
54
  "license": "ISC",
55
- "description": "增加ro语言",
55
+ "description": "getData不删旧数据,增量写文件,通过getData skip触发",
56
56
  "files": [
57
57
  "lib/",
58
58
  "index.js"