mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Accept a filePath in the set-user-settings IPC call
This commit is contained in:
@@ -113,10 +113,12 @@ class AtomApplication extends EventEmitter {
|
||||
? path.join(process.env.ATOM_HOME, 'config.json')
|
||||
: path.join(process.env.ATOM_HOME, 'config.cson')
|
||||
|
||||
this.configFile = new ConfigFile(configFilePath)
|
||||
this.configFile = ConfigFile.at(configFilePath)
|
||||
this.config = new Config({
|
||||
saveCallback: settings => {
|
||||
if (!this.quitting) return this.configFile.update(settings)
|
||||
if (!this.quitting) {
|
||||
return this.configFile.update(settings)
|
||||
}
|
||||
}
|
||||
})
|
||||
this.config.setSchema(null, {type: 'object', properties: _.clone(ConfigSchema)})
|
||||
@@ -561,8 +563,8 @@ class AtomApplication extends EventEmitter {
|
||||
window.setPosition(x, y)
|
||||
}))
|
||||
|
||||
this.disposable.add(ipcHelpers.respondTo('set-user-settings', (window, settings) =>
|
||||
this.configFile.update(JSON.parse(settings))
|
||||
this.disposable.add(ipcHelpers.respondTo('set-user-settings', (window, settings, filePath) =>
|
||||
ConfigFile.at(filePath || this.configFilePath).update(JSON.parse(settings))
|
||||
))
|
||||
|
||||
this.disposable.add(ipcHelpers.respondTo('center-window', window => window.center()))
|
||||
|
||||
Reference in New Issue
Block a user