UNPKG

cloudcms-cli

Version:
47 lines (43 loc) 1.49 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class ValidatePathIndexCommand extends AbstractCommand { constructor() { super({ "group": "path", "name": "validate-path-index", "description": "Validates the path index for a given 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": "repair", "type": "boolean", "description": "Automatically repair any discrepancies with the index", "required": false, "default": false, "args": ["repair"] }] } }); } handle(options, callback) { // call workhorse function helper.validatePathIndex(options.repositoryId, options.branchId, options.repair, function(err) { callback(err); }); } } module.exports = ValidatePathIndexCommand;