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.
Files changed (2) hide show
  1. package/index.js +6 -3
  2. 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) || isSkipFetch(url.href)) return
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) logger.error(`拉取 ${err.url} 时出现 404,如果您是第一次构建请忽略这个错误`)
277
- else throw err
277
+ if (err.status === 404) {
278
+ logger.error(`拉取 ${err.url} 时出现 404,如果您是第一次构建请忽略这个错误`)
279
+ resolve()
280
+ } else throw err
278
281
  })
279
282
  })
280
283
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-swpp",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "hexo-log": "^3.0.0",