hexo-swpp 1.4.4 → 1.4.6
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.
- package/index.js +8 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -274,8 +274,10 @@ const getJsonFromNetwork = path => new Promise(resolve => {
|
|
|
274
274
|
fetchFile(url)
|
|
275
275
|
.then(response => resolve(response.json()))
|
|
276
276
|
.catch(err => {
|
|
277
|
-
if (err.status === 404)
|
|
278
|
-
|
|
277
|
+
if (err.status === 404) {
|
|
278
|
+
logger.error(`拉取 ${err.url} 时出现 404,如果您是第一次构建请忽略这个错误`)
|
|
279
|
+
resolve()
|
|
280
|
+
} else throw err
|
|
279
281
|
})
|
|
280
282
|
})
|
|
281
283
|
|
|
@@ -365,7 +367,10 @@ const buildUpdateJson = (name, dif, oldUpdate) => {
|
|
|
365
367
|
if (
|
|
366
368
|
tidied.page.size === 0 && tidied.file.size === 0 &&
|
|
367
369
|
!(tidied.archives || tidied.categories || tidied.tags || tidied.index)
|
|
368
|
-
) return writeJson(oldUpdate
|
|
370
|
+
) return writeJson(oldUpdate ?? {
|
|
371
|
+
global: 0,
|
|
372
|
+
info: [{flag: 'all'}]
|
|
373
|
+
})
|
|
369
374
|
pushUpdateToInfo(newInfo, tidied)
|
|
370
375
|
const result = mergeUpdateWithOld(newInfo, oldUpdate, tidied)
|
|
371
376
|
return writeJson(result)
|