Restore the fs.existsSync guard

This commit is contained in:
Ash Wilson
2017-09-14 21:06:49 -04:00
parent c25b8570d7
commit 275089fdbe

View File

@@ -867,8 +867,9 @@ class Config
return if @savePending
try
fs.makeTreeSync(path.dirname(@configFilePath))
CSON.writeFileSync(@configFilePath, {}, {flag: 'wx'}) # fails if file exists
unless fs.existsSync(@configFilePath)
fs.makeTreeSync(path.dirname(@configFilePath))
CSON.writeFileSync(@configFilePath, {}, {flag: 'wx'}) # fails if file exists
catch error
if error.code isnt 'EEXIST'
@configFileHasErrors = true