mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-06 19:26:55 +08:00
fix(config): Rewrite contents, not just filename
This commit is contained in:
parent
7958d8cb5a
commit
27bb58e4ed
2 changed files with 12 additions and 6 deletions
|
@ -75,6 +75,17 @@ class Application
|
||||||
@sharedFileManager = new SharedFileManager()
|
@sharedFileManager = new SharedFileManager()
|
||||||
@nylasProtocolHandler = new NylasProtocolHandler(@resourcePath, @safeMode)
|
@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 = require '../config'
|
||||||
@config = new Config({@configDirPath, @resourcePath})
|
@config = new Config({@configDirPath, @resourcePath})
|
||||||
@config.load()
|
@config.load()
|
||||||
|
|
|
@ -331,12 +331,7 @@ class Config
|
||||||
@defaultSettings = {}
|
@defaultSettings = {}
|
||||||
@configFileHasErrors = false
|
@configFileHasErrors = false
|
||||||
|
|
||||||
# Temporary as we move away from cson
|
@configFilePath = path.join(@configDirPath, 'config.json')
|
||||||
oldConfigFilePath = fs.resolve(@configDirPath, 'config.cson')
|
|
||||||
newConfigFilePath = path.join(@configDirPath, 'config.json')
|
|
||||||
if oldConfigFilePath
|
|
||||||
fs.renameSync(oldConfigFilePath, newConfigFilePath)
|
|
||||||
@configFilePath = newConfigFilePath
|
|
||||||
|
|
||||||
@transactDepth = 0
|
@transactDepth = 0
|
||||||
@savePending = false
|
@savePending = false
|
||||||
|
|
Loading…
Add table
Reference in a new issue