Skip to content

Commit

Permalink
fix($markdown): notify error when not found snippet (close: #1872) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandevp authored and ulivz committed Oct 11, 2019
1 parent 7c973ab commit 6aaa7d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/@vuepress/markdown/lib/snippet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { fs, path } = require('@vuepress/shared-utils')
const { fs, logger, path } = require('@vuepress/shared-utils')

module.exports = function snippet (md, options = {}) {
const fence = md.renderer.rules.fence
Expand All @@ -15,8 +15,9 @@ module.exports = function snippet (md, options = {}) {
if (fs.existsSync(src)) {
token.content = fs.readFileSync(src, 'utf8')
} else {
token.content = 'Not found: ' + src
token.content = `Code snippet path not found: ${src}`
token.info = ''
logger.error(token.content)
}
}
return fence(...args)
Expand Down

0 comments on commit 6aaa7d7

Please sign in to comment.