mirror of
https://github.com/atom/atom.git
synced 2026-02-16 09:35:54 -05:00
Report deprecations in tasks
This commit is contained in:
@@ -41,6 +41,14 @@ handleEvents = ->
|
||||
result = handler.bind({async})(args...)
|
||||
emit('task:completed', result) unless isAsync
|
||||
|
||||
setupDeprecations = ->
|
||||
Grim = require 'grim'
|
||||
Grim.on 'updated', ->
|
||||
deprecations = Grim.getDeprecations().map (deprecation) -> deprecation.serialize()
|
||||
emit('task:deprecations', deprecations)
|
||||
Grim.clearDeprecations()
|
||||
|
||||
setupGlobals()
|
||||
handleEvents()
|
||||
setupDeprecations()
|
||||
handler = require(taskPath)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
_ = require 'underscore-plus'
|
||||
{fork} = require 'child_process'
|
||||
{Emitter} = require 'emissary'
|
||||
Grim = require 'grim'
|
||||
|
||||
# Extended: Run a node script in a separate process.
|
||||
#
|
||||
@@ -87,6 +88,9 @@ class Task
|
||||
@on "task:log", -> console.log(arguments...)
|
||||
@on "task:warn", -> console.warn(arguments...)
|
||||
@on "task:error", -> console.error(arguments...)
|
||||
@on "task:deprecations", (deprecations) ->
|
||||
Grim.addSerializedDeprecation(deprecation) for deprecation in deprecations
|
||||
return
|
||||
@on "task:completed", (args...) => @callback?(args...)
|
||||
|
||||
@handleEvents()
|
||||
|
||||
Reference in New Issue
Block a user