cloudcms-cli
Version:
Cloud CMS Command-Line client
57 lines (52 loc) • 1.81 kB
JavaScript
var helper = require("../../../helper");
var AbstractCommand = require("../../abstract");
class CreateProjectCommand extends AbstractCommand
{
constructor()
{
super({
"group": "platform",
"name": "create-project",
"description": "Creates a new Project",
"schema": {
"properties": [{
"name": "title",
"type": "string",
"description": "Enter the project title",
"required": true,
"args": ["title", "t"]
}, {
"name": "description",
"type": "string",
"description": "Enter optional project description",
"required": false,
"args": ["description", "d"]
}, {
"name": "type",
"type": "string",
"description": "Enter optional project type id or url",
"required": false,
"args": ["type", "y"]
}, {
"name": "strategy",
"type": "string",
"description": "Enter the strategy with which to import the source project",
"required": false,
"args": ["strategy"]
}]
}
});
}
handle(options, callback)
{
var importConfiguration = {};
if (options.strategy)
{
importConfiguration.strategy = options.strategy;
}
helper.createProject(options.title, options.description, options.type, importConfiguration, function(err) {
callback(err);
});
}
}
module.exports = CreateProjectCommand;