cloudcms-cli
Version:
Cloud CMS Command-Line client
46 lines (42 loc) • 1.42 kB
JavaScript
var helper = require("../../../helper");
var AbstractCommand = require("../../abstract");
class ResetBranchCommand extends AbstractCommand
{
constructor()
{
super({
"group": "branch",
"name": "reset",
"description": "Resets the tip changeset of a branch.",
"schema": {
"properties": [{
"name": "repositoryId",
"type": "string",
"description": "Enter the repository ID",
"required": true,
"args": ["repository", "r"]
}, {
"name": "branchId",
"type": "string",
"description": "Enter the branch ID",
"required": true,
"args": ["branch", "b"]
}, {
"name": "tipChangesetId",
"type": "string",
"description": "Enter the new tip changeset ID",
"required": true,
"args": ["tip", "changeset", "c"]
}]
}
});
}
handle(options, callback)
{
// call workhorse function
helper.resetBranch(options.repositoryId, options.branchId, options.tipChangesetId, function(err) {
callback(err);
});
}
}
module.exports = ResetBranchCommand;