"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.promptTargetPath = exports.promptDirName = exports.promptCreateNewDir = void 0;
const inquirer_1 = __importDefault(require("inquirer"));
const utils_1 = require("../../../utils");
async function promptCreateNewDir() {
    const { shouldCreateNewDir } = await inquirer_1.default.prompt([
        {
            type: 'confirm',
            name: 'shouldCreateNewDir',
            message: 'Do your want to create a new folder for your project? (If no, the files will be copied into your current path)',
        },
    ]);
    return shouldCreateNewDir;
}
exports.promptCreateNewDir = promptCreateNewDir;
async function promptDirName() {
    const { dirName } = await inquirer_1.default.prompt([
        {
            name: 'dirName',
            message: 'What do you want your directory to be called?',
        },
    ]);
    return dirName;
}
exports.promptDirName = promptDirName;
async function promptTargetPath() {
    const shouldCreateNewDir = await promptCreateNewDir();
    let targetDir = utils_1.CURRENT_DIR;
    let dirName = utils_1.CURRENT_DIR_NAME;
    if (shouldCreateNewDir) {
        dirName = await promptDirName();
        targetDir = utils_1.path.join(utils_1.CURRENT_DIR, dirName || '');
    }
    return { shouldCreateNewDir, dirName, targetDir };
}
exports.promptTargetPath = promptTargetPath;
