LocalMachinepacks.copyMachine()

Copy a machine in a local pack and update the package.json file.

Usage

Hover over inputs/exits for more info.

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


// Copy a machine in a local pack and update the package.json file.

LocalMachinepacks.copyMachine({

dir: '/Users/mikermcneil/machinepack-foo/',

originalIdentity: 'do-stuff',

newIdentity: 'copy-of-do-stuff',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// No machine with the specified identity exists in this machinepack.

notFound: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

dir required

The path to the machinepack (if path is not absolute, will be resolved from the current working directory)

'/Users/mikermcneil/machinepack-foo/'
originalIdentity required

Identity of the machine to copy

'do-stuff'
newIdentity required

Identity of the new machine

'copy-of-do-stuff'

Exits

error

An unexpected error occurred.

notFound

No machine with the specified identity exists in this machinepack.

success

OK.