cloudcms-cli
Version:
Cloud CMS Command-Line client
62 lines (57 loc) • 2.07 kB
JavaScript
var helper = require("../../../helper");
var AbstractCommand = require("../../abstract");
class FixBranchTipCommand extends AbstractCommand
{
constructor()
{
super({
"group": "admin",
"name": "fix-branch-tip",
"description": "Fixes a branch tip.",
"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": "commit",
"type": "boolean",
"description": "Whether to commit a fix",
"required": false,
"default": false,
"args": ["commit"]
}, {
"name": "tip",
"type": "string",
"description": "Force to specific changeset ID",
"required": false,
"args": ["tip"]
}, {
"name": "buildView",
"type": "boolean",
"description": "Whether to rebuild the branch view",
"required": false,
"args": ["buildView"]
}]
}
});
}
// NOTE: Username and password are not being used, can we remove them?
handle(options, callback)
{
// call workhorse function
helper.fixBranchTip(options.repositoryId, options.branchId, options.commit, options.tip, options.buildView, function(err) {
console.log(""); // this forces stdout to flush
callback(err);
});
}
}
module.exports = FixBranchTipCommand;