diff --git a/packages/core/lib/plugins/execute.js b/packages/core/lib/plugins/execute.js index 5805ca67b..4e2d4bec5 100644 --- a/packages/core/lib/plugins/execute.js +++ b/packages/core/lib/plugins/execute.js @@ -10,14 +10,13 @@ module.exports = { require: ['@nikitajs/core/lib/plugins/tools_find', '@nikitajs/core/lib/plugins/tools_walk'], hooks: { 'nikita:action': { - // after: '@nikitajs/core/lib/plugins/tools_find' handler: async function({ config, metadata, tools: {find, walk} }) { var env; - if (metadata.namespace.join('.') !== 'execute') { + if (metadata.module !== '@nikitajs/core/lib/actions/execute') { return; } if (config.arch_chroot == null) { diff --git a/packages/core/lib/plugins/ssh.js b/packages/core/lib/plugins/ssh.js index c8bc01aa7..e44ca78f0 100644 --- a/packages/core/lib/plugins/ssh.js +++ b/packages/core/lib/plugins/ssh.js @@ -15,22 +15,16 @@ module.exports = { name: '@nikitajs/core/lib/plugins/ssh', require: ['@nikitajs/core/lib/plugins/tools_find'], hooks: { - 'nikita:normalize': function(action, handler) { - var ssh; - if (action.metadata.namespace[0] === 'ssh') { - // Dont interfere with ssh actions - return handler; - } - if (action.hasOwnProperty('ssh')) { - ssh = action.ssh; - delete action.ssh; - } - return async function() { - action = (await handler.call(null, ...arguments)); - action.ssh = ssh; - return action; - }; - }, + // 'nikita:normalize': (action, handler) -> + // # Dont interfere with ssh actions + // return handler if action.metadata.namespace[0] is 'ssh' + // if action.hasOwnProperty 'ssh' + // ssh = action.ssh + // delete action.ssh + // -> + // action = await handler.call null, ...arguments + // action.ssh = ssh + // action 'nikita:action': async function(action) { var i, len, ref, ref1, ref2, sibling, ssh; // Is there a connection to open @@ -64,7 +58,7 @@ module.exports = { // Find SSH open in previous siblings for (i = 0, len = ref.length; i < len; i++) { sibling = ref[i]; - if (sibling.metadata.namespace.join('.') !== 'ssh.open') { + if (sibling.metadata.module !== '@nikitajs/core/lib/actions/ssh/open') { continue; } if (sibling.output.ssh) { diff --git a/packages/core/src/metadata/tmpdir.coffee b/packages/core/src/metadata/tmpdir.coffee index db8593371..c422570a0 100644 --- a/packages/core/src/metadata/tmpdir.coffee +++ b/packages/core/src/metadata/tmpdir.coffee @@ -22,8 +22,8 @@ module.exports = handler: (action) -> {config, metadata, tools} = action throw utils.error 'METADATA_TMPDIR_INVALID', [ - 'the "tmpdir" metadata value must be a boolean or a string,' - "got #{typeof metadata.tmpdir}" + 'the "tmpdir" metadata value must be a boolean, a function or a string,' + "got #{JSON.stringify metadata.tmpdir}" ] unless typeof metadata.tmpdir in ['boolean', 'function', 'string', 'undefined'] return unless metadata.tmpdir # SSH connection extraction diff --git a/packages/core/src/plugins/execute.coffee b/packages/core/src/plugins/execute.coffee index 1fa1c4b3a..7febfc6fa 100644 --- a/packages/core/src/plugins/execute.coffee +++ b/packages/core/src/plugins/execute.coffee @@ -10,9 +10,8 @@ module.exports = ] hooks: 'nikita:action': - # after: '@nikitajs/core/src/plugins/tools_find' handler: ({config, metadata, tools: {find, walk}}) -> - return unless metadata.namespace.join('.') is 'execute' + return unless metadata.module is '@nikitajs/core/src/actions/execute' config.arch_chroot ?= await find ({metadata: {arch_chroot}}) -> arch_chroot config.arch_chroot_rootdir ?= await find ({metadata: {arch_chroot_rootdir}}) -> arch_chroot_rootdir config.bash ?= await find ({metadata: {bash}}) -> bash diff --git a/packages/core/src/plugins/ssh.coffee b/packages/core/src/plugins/ssh.coffee index 67d0c2972..a57fb042a 100644 --- a/packages/core/src/plugins/ssh.coffee +++ b/packages/core/src/plugins/ssh.coffee @@ -14,16 +14,16 @@ module.exports = '@nikitajs/core/src/plugins/tools_find' ] hooks: - 'nikita:normalize': (action, handler) -> - # Dont interfere with ssh actions - return handler if action.metadata.namespace[0] is 'ssh' - if action.hasOwnProperty 'ssh' - ssh = action.ssh - delete action.ssh - -> - action = await handler.call null, ...arguments - action.ssh = ssh - action + # 'nikita:normalize': (action, handler) -> + # # Dont interfere with ssh actions + # return handler if action.metadata.namespace[0] is 'ssh' + # if action.hasOwnProperty 'ssh' + # ssh = action.ssh + # delete action.ssh + # -> + # action = await handler.call null, ...arguments + # action.ssh = ssh + # action 'nikita:action': (action) -> # Is there a connection to open if action.ssh and not utils.ssh.is action.ssh @@ -59,7 +59,7 @@ module.exports = ] # Find SSH open in previous siblings for sibling in action.siblings - continue unless sibling.metadata.namespace.join('.') is 'ssh.open' + continue unless sibling.metadata.module is '@nikitajs/core/src/actions/ssh/open' if sibling.output.ssh ssh = sibling.output.ssh break