mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Set config schema entirely in the snapshot
This commit is contained in:
@@ -210,18 +210,12 @@ class AtomEnvironment extends Model
|
||||
|
||||
@views.initialize()
|
||||
|
||||
@config.initialize({@configDirPath, resourcePath})
|
||||
@projectHomeSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
projectHome: {
|
||||
type: 'string',
|
||||
default: path.join(fs.getHomeDirectory(), 'github'),
|
||||
description: 'The directory where projects are assumed to be located. Packages created using the Package Generator will be stored here by default.'
|
||||
}
|
||||
}
|
||||
ConfigSchema.projectHome = {
|
||||
type: 'string',
|
||||
default: path.join(fs.getHomeDirectory(), 'github'),
|
||||
description: 'The directory where projects are assumed to be located. Packages created using the Package Generator will be stored here by default.'
|
||||
}
|
||||
@config.setSchema('core', @projectHomeSchema)
|
||||
@config.initialize({@configDirPath, resourcePath, projectHomeSchema: ConfigSchema.projectHome})
|
||||
|
||||
@keymaps.configDirPath = @configDirPath
|
||||
@keymaps.resourcePath = resourcePath
|
||||
@@ -322,7 +316,6 @@ class AtomEnvironment extends Model
|
||||
|
||||
@config.clear()
|
||||
@config.setSchema null, {type: 'object', properties: _.clone(ConfigSchema)}
|
||||
@config.setSchema('core', @projectHomeSchema)
|
||||
|
||||
@keymaps.clear()
|
||||
@keymaps.loadBundledKeymaps()
|
||||
|
||||
@@ -401,11 +401,13 @@ class Config
|
||||
constructor: ({@notificationManager, @enablePersistence}={}) ->
|
||||
@clear()
|
||||
|
||||
initialize: ({@configDirPath, @resourcePath}) ->
|
||||
initialize: ({@configDirPath, @resourcePath, projectHomeSchema}) ->
|
||||
if @enablePersistence?
|
||||
@configFilePath = fs.resolve(@configDirPath, 'config', ['json', 'cson'])
|
||||
@configFilePath ?= path.join(@configDirPath, 'config.cson')
|
||||
|
||||
@schema.properties.core.properties.projectHome = projectHomeSchema
|
||||
|
||||
clear: ->
|
||||
@emitter = new Emitter
|
||||
@schema =
|
||||
|
||||
@@ -17,6 +17,7 @@ url = require 'url'
|
||||
_ = require 'underscore-plus'
|
||||
FindParentDir = null
|
||||
Resolve = null
|
||||
ConfigSchema = require '../config-schema'
|
||||
|
||||
LocationSuffixRegExp = /(:\d+)(:\d+)?$/
|
||||
|
||||
@@ -69,8 +70,13 @@ class AtomApplication
|
||||
@windows = []
|
||||
|
||||
@config = new Config({enablePersistence: true})
|
||||
@config.initialize({configDirPath: process.env.ATOM_HOME, @resourcePath})
|
||||
@config.setSchema null, {type: 'object', properties: _.clone(require('../config-schema'))}
|
||||
@config.setSchema null, {type: 'object', properties: _.clone(ConfigSchema)}
|
||||
ConfigSchema.projectHome = {
|
||||
type: 'string',
|
||||
default: path.join(fs.getHomeDirectory(), 'github'),
|
||||
description: 'The directory where projects are assumed to be located. Packages created using the Package Generator will be stored here by default.'
|
||||
}
|
||||
@config.initialize({configDirPath: process.env.ATOM_HOME, @resourcePath, projectHomeSchema: ConfigSchema.projectHome})
|
||||
@config.load()
|
||||
@fileRecoveryService = new FileRecoveryService(path.join(process.env.ATOM_HOME, "recovery"))
|
||||
@storageFolder = new StorageFolder(process.env.ATOM_HOME)
|
||||
|
||||
Reference in New Issue
Block a user