Merge pull request #791 from diegodorado/rc-file-check
Wraps .jsbeautifyrc file read into a try/catch since it could be no l…
This commit is contained in:
commit
19be23015a
|
@ -637,9 +637,12 @@ module.exports = class Beautifiers extends EventEmitter
|
|||
externalOptions = undefined
|
||||
if configPath
|
||||
fs ?= require("fs")
|
||||
try
|
||||
contents = fs.readFileSync(configPath,
|
||||
encoding : "utf8"
|
||||
)
|
||||
catch error
|
||||
contents = null #file isnt available anymore
|
||||
unless contents
|
||||
externalOptions = {}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue