mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Call AtomPackage::activateConfig from AtomPackage::activateNow
Previously this method was unused and so packages implementing activateConfig were not being called.
This commit is contained in:
@@ -43,17 +43,19 @@ class AtomPackage extends Package
|
||||
|
||||
activateNow: ->
|
||||
try
|
||||
if @requireMainModule()
|
||||
config.setDefaults(@name, @mainModule.configDefaults)
|
||||
@mainModule.activate(atom.getPackageState(@name) ? {})
|
||||
@activateConfig()
|
||||
@mainModule.activate(atom.getPackageState(@name) ? {}) if @requireMainModule()
|
||||
catch e
|
||||
console.warn "Failed to activate package named '#{@name}'", e.stack
|
||||
|
||||
activateConfig: ->
|
||||
@activateResources()
|
||||
if @requireMainModule()
|
||||
return if @configActivated
|
||||
|
||||
@requireMainModule()
|
||||
if @mainModule?
|
||||
config.setDefaults(@name, @mainModule.configDefaults)
|
||||
@mainModule?.activateConfig?()
|
||||
@mainModule.activateConfig?()
|
||||
@configActivated = true
|
||||
|
||||
activateResources: ->
|
||||
keymap.add(keymapPath, map) for [keymapPath, map] in @keymaps
|
||||
@@ -123,7 +125,7 @@ class AtomPackage extends Package
|
||||
applyStylesheet(stylesheetPath, content) for [stylesheetPath, content] in @stylesheets
|
||||
|
||||
requireMainModule: ->
|
||||
return @mainModule if @mainModule
|
||||
return @mainModule if @mainModule?
|
||||
mainModulePath = @getMainModulePath()
|
||||
@mainModule = require(mainModulePath) if fsUtils.isFileSync(mainModulePath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user