Skip to content

Commit

Permalink
check if file exists before chktex nscaife#38
Browse files Browse the repository at this point in the history
  • Loading branch information
nscaife committed Jun 6, 2017
1 parent 8e73ff2 commit 7cd679f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/linter-chktex.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ module.exports =
scope: 'file'
lintOnFly: false
lint: (textEditor) =>
return @lintFile textEditor.getPath()
.then @parseOutput
if fs.existsSync(textEditor.getPath())
return @lintFile textEditor.getPath()
.then @parseOutput
console.log 'file does not exist'
return []

lintFile: (filePath) ->
args = [filePath, '-q', '-I0', '-f%f:%l:%c:%d:%k:%n:%m\\n']
Expand Down

0 comments on commit 7cd679f

Please sign in to comment.