cloudcms-cli
Version:
Cloud CMS Command-Line client
40 lines (36 loc) • 1.13 kB
JavaScript
var helper = require("../../../helper");
var AbstractCommand = require("../../abstract");
class DeleteBranchCommand extends AbstractCommand
{
constructor()
{
super({
"group": "repository",
"name": "delete-branch",
"description": "Deletes 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", "id"]
}]
}
});
}
handle(options, callback)
{
// call workhorse function
helper.deleteBranch(options.repositoryId, options.branchId, function(err) {
callback(err);
});
}
}
module.exports = DeleteBranchCommand;