"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.confirmOptions = void 0;
const inquirer_1 = __importDefault(require("inquirer"));
const utils_1 = require("../../../utils");
function formatTemplate(template) {
    return ['\t', '- ', template].join('');
}
async function confirmOptions(opts) {
    const { shouldInstallDependencies, namespace, targetDir, templates } = opts;
    const templateString = templates.map(formatTemplate).join('\n');
    utils_1.log('---');
    utils_1.log('The Grund boilerplate will:');
    utils_1.log(`- be copied and installed into: ${targetDir}`);
    utils_1.log(`- have the namespace: ${namespace}`);
    utils_1.log(`- Install the following templates: \n ${templateString}`);
    utils_1.log.assert(shouldInstallDependencies, `- install its dependencies`);
    const { confirmed } = await inquirer_1.default.prompt([
        {
            type: 'confirm',
            name: 'confirmed',
            message: `Sounds good?`,
        },
    ]);
    if (!confirmed) {
        utils_1.log('Coward...');
        process.exit(1);
    }
}
exports.confirmOptions = confirmOptions;
