cloudcms-cli
Version:
Cloud CMS Command-Line client
64 lines (60 loc) • 2.36 kB
JavaScript
var helper = require("../../../helper");
var AbstractCommand = require("../../abstract");
class ExportBranchCommand extends AbstractCommand
{
constructor()
{
super({
"group": "branch",
"name": "export",
"description": "Exports a branch to an archive",
"schema": {
"properties": [{
"name": "repositoryId",
"type": "string",
"description": "Enter the repository ID:",
"helper": "The ID of the repository where the branch lives",
"required": true,
"args": ["repository", "r"]
}, {
"name": "branchId",
"type": "string",
"description": "Enter the branch ID:",
"helper": "The ID of the branch",
"required": false,
"default": "master",
"args": ["branch", "b"]
}, {
"name": "group",
"type": "string",
"description": "Enter the archive group ID:",
"helper": "The group ID of the archive that should be exported",
"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 exported",
"required": true,
"args": ["artifact", "a"]
}, {
"name": "version",
"type": "string",
"description": "Enter the archive version ID:",
"helper": "The version of the archive that should be exported",
"required": true,
"args": ["version", "v"]
}]
}
});
}
handle(options, callback)
{
// call workhorse function
helper.exportBranchToArchive(options.repositoryId, options.branchId, options.group, options.artifact, options.version, function(err) {
callback(err);
});
}
}
module.exports = ExportBranchCommand;