Skip to content

Commit

Permalink
fix(core): remove usage of run
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Feb 26, 2021
1 parent 7d16d96 commit 33be522
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 41 deletions.
26 changes: 6 additions & 20 deletions packages/core/lib/plugins/ssh.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions packages/core/lib/session.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 4 additions & 12 deletions packages/core/src/plugins/ssh.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,24 @@ module.exports =
action.ssh or false
if ssh and not utils.ssh.is ssh
{ssh} = await session
# Need to inject `tools.log`
plugins: [
plugins: [ # Need to inject `tools.log`
require '../plugins/tools_events'
require '../plugins/tools_log'
require '../metadata/status'
require '../plugins/history'
]
, ({run}) -> run
metadata:
namespace: ['ssh', 'open']
config: ssh
.ssh.open config: ssh
action.metadata.ssh_dispose = true
else if ssh is false
ssh = null
action.ssh = ssh
'nikita:result': ({action}) ->
if action.metadata.ssh_dispose
await session
# Need to inject `tools.log`
plugins: [
plugins: [ # Need to inject `tools.log`
require '../plugins/tools_events'
require '../plugins/tools_log'
require '../metadata/status'
require '../plugins/history'
]
, ({run}) -> run
metadata:
namespace: ['ssh', 'close']
config: ssh: action.ssh
.ssh.close ssh: action.ssh
3 changes: 0 additions & 3 deletions packages/core/src/session.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ session = (action={}) ->
await action.plugins.call
name: 'nikita:register'
args: name: name, action: act
# Register run helper
action.run = ->
run parent: action, ...arguments
# Local scheduler to execute children and be notified on finish
action.scheduler = schedule()
# Expose the action context
Expand Down

0 comments on commit 33be522

Please sign in to comment.