hexo-swpp 1.4.3 → 1.4.5
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 +6 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -159,7 +159,8 @@ const buildNewJson = path => new Promise(resolve => {
|
|
|
159
159
|
if (!link.match(/^(http|\/\/)/) || cache.has(link)) return
|
|
160
160
|
cache.add(link)
|
|
161
161
|
const url = new URL(link.startsWith('/') ? `http:${link}` : link)
|
|
162
|
-
if (url.hostname === domain || !findCache(url) || isExclude(url.href)
|
|
162
|
+
if (url.hostname === domain || !findCache(url) || isExclude(url.href)) return
|
|
163
|
+
if (isSkipFetch(url.href)) result[decodeURIComponent(link)] = '0'
|
|
163
164
|
taskList.push(
|
|
164
165
|
fetchFile(link)
|
|
165
166
|
.then(response => response.text())
|
|
@@ -273,8 +274,10 @@ const getJsonFromNetwork = path => new Promise(resolve => {
|
|
|
273
274
|
fetchFile(url)
|
|
274
275
|
.then(response => resolve(response.json()))
|
|
275
276
|
.catch(err => {
|
|
276
|
-
if (err.status === 404)
|
|
277
|
-
|
|
277
|
+
if (err.status === 404) {
|
|
278
|
+
logger.error(`拉取 ${err.url} 时出现 404,如果您是第一次构建请忽略这个错误`)
|
|
279
|
+
resolve()
|
|
280
|
+
} else throw err
|
|
278
281
|
})
|
|
279
282
|
})
|
|
280
283
|
|