UNPKG

cloudcms-cli

Version:
58 lines (54 loc) 1.94 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class RegisterModuleCommand extends AbstractCommand { constructor() { super({ "group": "module", "name": "register", "description": "Registers a Module", "schema": { "properties": [{ "name": "id", "type": "string", "description": "Enter the module ID", "required": true, "args": ["id"] }, { "name": "sourceType", "type": "string", "description": "Enter the module source type", "required": true, "args": ["sourceType", "type"] }, { "name": "sourceUrl", "type": "string", "description": "Enter the module source URL", "required": true, "args": ["sourceUrl", "url"] }, { "name": "sourcePath", "type": "string", "description": "Enter the module source path", "required": false, "args": ["sourcePath", "path"] }, { "name": "sourceBranch", "type": "string", "description": "Enter the module source branch", "required": false, "args": ["sourceBranch", "branch"] }] } }); } handle(options, callback) { // call workhorse function helper.registerModule(options.id, options.sourceType, options.sourceUrl, options.sourcePath, options.sourceBranch, function(err) { callback(err); }); } } module.exports = RegisterModuleCommand;