mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-08 21:55:54 +08:00
fix(config): Rewrite contents, not just filename
This commit is contained in:
parent
d00373bae9
commit
ef61a3ec9a
2 changed files with 12 additions and 6 deletions
|
@ -75,6 +75,17 @@ class Application
|
|||
@sharedFileManager = new SharedFileManager()
|
||||
@nylasProtocolHandler = new NylasProtocolHandler(@resourcePath, @safeMode)
|
||||
|
||||
|
||||
# Temporary as we move away from cson
|
||||
CSON = require 'season'
|
||||
oldConfigFilePath = fs.resolve(@configDirPath, 'config.cson')
|
||||
newConfigFilePath = path.join(@configDirPath, 'config.json')
|
||||
if oldConfigFilePath
|
||||
userConfig = CSON.readFileSync(oldConfigFilePath)
|
||||
fs.writeFileSync(newConfigFilePath, JSON.stringify(userConfig, null, 2))
|
||||
fs.unlinkSync(oldConfigFilePath)
|
||||
# End temporary
|
||||
|
||||
Config = require '../config'
|
||||
@config = new Config({@configDirPath, @resourcePath})
|
||||
@config.load()
|
||||
|
|
|
@ -331,12 +331,7 @@ class Config
|
|||
@defaultSettings = {}
|
||||
@configFileHasErrors = false
|
||||
|
||||
# Temporary as we move away from cson
|
||||
oldConfigFilePath = fs.resolve(@configDirPath, 'config.cson')
|
||||
newConfigFilePath = path.join(@configDirPath, 'config.json')
|
||||
if oldConfigFilePath
|
||||
fs.renameSync(oldConfigFilePath, newConfigFilePath)
|
||||
@configFilePath = newConfigFilePath
|
||||
@configFilePath = path.join(@configDirPath, 'config.json')
|
||||
|
||||
@transactDepth = 0
|
||||
@savePending = false
|
||||
|
|
Loading…
Add table
Reference in a new issue