Skip to content

How to add a custom command? #19

Description

@depsimon

I'd like to create a custom command, and maybe make a plugin out of it for those who might need it.

I don't see any documentation on how to do it, and current plugins don't add commands.

Current plugin looks like this

module.exports = {

  loadPlugin: function() {

    module.exports = Object.assign(module.exports, {

      'init:api:addfunction:hook': function() {

        console.log('custom command')

        return {};
      }
    });

    delete module.exports.loadPlugin;
  },
  name: 'fresh',
  hooks: [
    'init:api:addfunction:hook'
  ]
};

It's loaded successfully as a plugin but I can't find out how to add it to the bin file & add it as an actual command


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions