mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Support single string activationEvents
This commit is contained in:
@@ -137,6 +137,8 @@ class AtomPackage extends Package
|
||||
return unless @metadata.activationEvents?
|
||||
if _.isArray(@metadata.activationEvents)
|
||||
rootView.command(event, @handleActivationEvent) for event in @metadata.activationEvents
|
||||
else if _.isString(@metadata.activationEvents)
|
||||
rootView.command(@metadata.activationEvents, @handleActivationEvent)
|
||||
else
|
||||
rootView.command(event, selector, @handleActivationEvent) for event, selector of @metadata.activationEvents
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
'main': './lib/command-palette-view'
|
||||
'description': 'Find and run available commands.'
|
||||
'activationEvents': ['command-palette:toggle']
|
||||
'activationEvents': 'command-palette:toggle'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
'main': './lib/sign-in-view'
|
||||
'description': 'Sign in to GitHub. Open from the command palette.'
|
||||
'activationEvents': [
|
||||
'github:sign-in'
|
||||
]
|
||||
'activationEvents': 'github:sign-in'
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
'main': './lib/grammar-selector'
|
||||
'description': 'Select the grammar to use for the current editor.'
|
||||
'activationEvents': ['grammar-selector:show']
|
||||
'activationEvents': 'grammar-selector:show'
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
'main': './lib/package-generator'
|
||||
'description': 'Generate and open a new sample package.'
|
||||
'activationEvents': ['package-generator:generate']
|
||||
'activationEvents': 'package-generator:generate'
|
||||
|
||||
Reference in New Issue
Block a user