UNPKG

cloudcms-cli

Version:
56 lines (52 loc) 1.99 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class ExportProjectCommand extends AbstractCommand { constructor() { super({ "group": "project", "name": "export", "description": "Exports a project to an archive", "schema": { "properties": [{ "name": "projectId", "type": "string", "description": "Enter the project ID:", "helper": "The ID of the project", "required": true, "args": ["projectId", "project", "id"] }, { "name": "group", "type": "string", "description": "Enter the archive group ID:", "helper": "The group ID of the archive that should be exported", "required": true, "args": ["group", "g"] }, { "name": "artifact", "type": "string", "description": "Enter the archive artifact ID:", "helper": "The artifact ID of the archive that should be exported", "required": true, "args": ["artifact", "a"] }, { "name": "version", "type": "string", "description": "Enter the archive version ID:", "helper": "The version of the archive that should be exported", "required": true, "args": ["version", "v"] }] } }); } handle(options, callback) { // call workhorse function helper.exportProjectToArchive(options.projectId, options.group, options.artifact, options.version, function(err) { callback(err); }); } } module.exports = ExportProjectCommand;