From f99e24cf6cd4d5d37460f83720bc96a3673ecb60 Mon Sep 17 00:00:00 2001 From: Diego Dorado Date: Tue, 9 Feb 2016 12:19:16 -0300 Subject: [PATCH] Wraps .jsbeautifyrc file read into a try/catch since it could be no longer available. --- src/beautifiers/index.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/beautifiers/index.coffee b/src/beautifiers/index.coffee index da3dce7..58fd2c6 100644 --- a/src/beautifiers/index.coffee +++ b/src/beautifiers/index.coffee @@ -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