Add atom.activatePackage(id) method

It will load the specified package if it hasn't already been loaded.
This commit is contained in:
Nathan Sobo 2013-03-22 20:11:57 -06:00
parent b64f5b2a85
commit ae444d1ea3

View File

@ -78,13 +78,19 @@ _.extend atom,
_.detect @activePackages, (pack) -> pack.path is path
activatePackages: ->
for pack in @loadedPackages
@activatePackage(pack.path) for pack in @getLoadedPackages()
activatePackage: (id) ->
if pack = @loadPackage(id)
@activePackages.push(pack)
pack.activate()
getLoadedPackages: ->
_.clone(@loadedPackages)
getActivePackages: ->
_.clone(@activePackages)
getPackagePaths: ->
packagePaths = []
for packageDirPath in config.packageDirPaths