(options, imports, register)
| 6 | var SUPPORTED = []; |
| 7 | |
| 8 | function setup(options, imports, register) { |
| 9 | // Import |
| 10 | var logger = imports.logger.namespace("deployment"); |
| 11 | var events = imports.events; |
| 12 | var workspace = imports.workspace; |
| 13 | |
| 14 | // Return a specific solution |
| 15 | var getSolution = function(solutionId) { |
| 16 | return _.find(SUPPORTED, function(solution) { |
| 17 | return solution.infos.id == solutionId; |
| 18 | }); |
| 19 | }; |
| 20 | |
| 21 | // Add a solution |
| 22 | var addSolution = function(solution) { |
| 23 | if (!_.isArray(solution)) solution = [solution]; |
| 24 | _.each(solution, function(_sol) { |
| 25 | SUPPORTED.push(new DeploymentSolution(workspace, events, logger, _sol)); |
| 26 | }); |
| 27 | }; |
| 28 | |
| 29 | // Register |
| 30 | register(null, { |
| 31 | 'deploy': { |
| 32 | 'SUPPORTED': SUPPORTED, |
| 33 | 'get': getSolution, |
| 34 | 'add': addSolution |
| 35 | } |
| 36 | }); |
| 37 | } |
| 38 | |
| 39 | // Exports |
| 40 | module.exports = setup; |
nothing calls this directly
no test coverage detected