MCPcopy
hub / github.com/CodeboxIDE/codebox / setup

Function setup

core/cb.deploy/main.js:8–37  ·  view source on GitHub ↗
(options, imports, register)

Source from the content-addressed store, hash-verified

6var SUPPORTED = [];
7
8function 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
40module.exports = setup;

Callers

nothing calls this directly

Calls 1

registerFunction · 0.85

Tested by

no test coverage detected