UNPKG

cloudcms-cli

Version:
63 lines (59 loc) 2.34 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class ImportBranchCommand extends AbstractCommand { constructor() { super({ "group": "branch", "name": "import", "description": "Imports an archive into a branch", "schema": { "properties": [{ "name": "group", "type": "string", "description": "Enter the archive group ID:", "helper": "The group ID of the archive that should be imported", "required": true, "args": ["group", "g"] }, { "name": "artifact", "type": "string", "description": "Enter the archive artifact ID:", "helper": "The artifact ID of the archive that should be imported", "required": true, "args": ["artifact", "a"] }, { "name": "version", "type": "string", "description": "Enter the archive version ID:", "helper": "The version of the archive that should be imported", "required": true, "args": ["version", "v"] }, { "name": "repositoryId", "type": "string", "description": "Enter the repository ID:", "helper": "The ID of the Repository where the target Branch lives", "required": true, "args": ["repository", "r"] }, { "name": "branchId", "type": "string", "description": "Enter the branch ID:", "helper": "The ID of the target Branch", "required": true, "args": ["branch", "b"] }, ] } }); } handle(options, callback) { // call workhorse function helper.importArchiveToBranch(options.repositoryId, options.branchId, options.group, options.artifact, options.version, function(err) { callback(err); }); } } module.exports = ImportBranchCommand;