Skip to content

Publishing and Commands

conoremclaughlin edited this page Jan 22, 2013 · 1 revision

Check Bones documentation and run node ./index.js --help to get the basics.

Commands

  • commands.PublishTemplate given a view and model name, write a template file. Use it with backbone-forms to create form templates for your models.
  • commands.PublishMirror given a mirror name writes a content file to a directory. Optional minification.
  • commands.PublishAllMirrors writes all mirrors to a directory. Optional minification.
  • Bones.Command.extractOptions(command, plugin) returns an object of all the options for a command from Bones.plugin.config.

Notes

  • A command does not run start, so you cannot count on any functions you've place in Bones.plugin.boostrapList to run before hand.

How To

How do I write my own command? Where are the arguments to my command?!

Bones reads arguments to your command into Bones.plugin.config. Retrieve them from there or use Bones.Command.extractOptions to parse them out for you.

commands/PublishMirror#initialize(...)

var options = command.extractOptions(command, plugin);
  , mirrorName = options.mirror;
Clone this wiki locally