LocalMachinepacks.runMachineInteractive()

Run a machine in the specified local pack, prompting for required input values.

Usage

Hover over inputs/exits for more info.

var LocalMachinepacks = require('machinepack-localmachinepacks');


// Run a machine in the specified local pack, prompting for required input values.

LocalMachinepacks.runMachineInteractive({

machinepackPath: '/Users/mikermcneil/machinepack-foo/machines/bar.js',

identity: 'foo-bar',

inputValues: [ { name: 'someInput', value: 'some configured string value for the input', protect: false } ],

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// No file exists at the specified path

notFound: function () {

 

},

// Invalid machine definition

invalidMachine: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

machinepackPath required

The path to the machinepack this machine is a part of (if path is not absolute, will be resolved from the current working directory)

'/Users/mikermcneil/machinepack-foo/machines/bar.js'
identity required

The identity of the machine to run.

'foo-bar'
inputValues

A set of input values (interactive prompt will be skipped for required inputs provided this way)

[ { name: 'someInput',
    value: 'some configured string value for the input',
    protect: false } ]

Exits

error

An unexpected error occurred.

notFound

No file exists at the specified path

invalidMachine

Invalid machine definition

success

OK.

{ withInputs: [ { name: 'foobar', protect: false, value: 'fiddle diddle' } ],
  exited: 
   { outcome: 'success',
     output: '===',
     jsonStringifiedOutput: '{"stuff": "things"}',
     inspectedOutput: '{ stuff: "things" }',
     duration: 2582 } }