"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const getIntegrations_1 = tslib_1.__importDefault(require("../utils/getIntegrations"));
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
const copyProject_1 = tslib_1.__importDefault(require("../scripts/copyProject"));
const path_1 = tslib_1.__importDefault(require("path"));
exports.default = async (args) => {
    let projectName = args[0];
    if (!projectName) {
        const { typedProjectName } = await inquirer_1.default.prompt([
            {
                type: 'input',
                name: 'typedProjectName',
                message: 'What\'s your project name?',
                validate(value) {
                    if (value.trim().length > 0) {
                        return true;
                    }
                    return 'Please provide longer name';
                }
            }
        ]);
        projectName = typedProjectName;
    }
    const integrations = getIntegrations_1.default();
    const { chosenIntegration } = await inquirer_1.default
        .prompt([
        {
            type: 'list',
            name: 'chosenIntegration',
            message: 'Choose integration',
            choices: integrations
        }
    ]);
    return copyProject_1.default(chosenIntegration, path_1.default.resolve(process.cwd(), projectName), projectName);
};
//# sourceMappingURL=init.js.map