mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Merge pull request #15656 from atom/aw-extra-write-guard
Restore the fs.existsSync guard in Config
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user