UNPKG

cloudcms-cli

Version:
52 lines (48 loc) 1.6 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class ReadNodeCommand extends AbstractCommand { constructor() { super({ "group": "branch", "name": "read-node", "description": "Reads a node", "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": "nodeId", "type": "string", "description": "Enter the node ID", "required": false, "args": ["node", "n", "id"] }, { "name": "path", "type": "string", "description": "Enter the node path", "required": false, "args": ["path"] }] } }); } handle(options, callback) { // call workhorse function helper.readNode(options.repositoryId, options.branchId, options.nodeId, options.path, function(err) { callback(err); }); } } module.exports = ReadNodeCommand;