Wraps .jsbeautifyrc file read into a try/catch since it could be no longer available.

This commit is contained in:
Diego Dorado 2016-02-09 12:19:16 -03:00
parent 1cb84db4f9
commit f99e24cf6c
1 changed files with 6 additions and 3 deletions

View File

@ -633,9 +633,12 @@ module.exports = class Beautifiers extends EventEmitter
externalOptions = undefined
if configPath
fs ?= require("fs")
contents = fs.readFileSync(configPath,
encoding : "utf8"
)
try
contents = fs.readFileSync(configPath,
encoding : "utf8"
)
catch error
contents = null #file isnt available anymore
unless contents
externalOptions = {}
else