mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 16:08:24 +03:00
Add atom.activatePackage(id)
method
It will load the specified package if it hasn't already been loaded.
This commit is contained in:
parent
b64f5b2a85
commit
ae444d1ea3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user