"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = promptOverwriteDir;

var _inquirer = _interopRequireDefault(require("inquirer"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Prompt if user wants to overwrite the course/Nanodegree directory
 * @param {string} dir directory name
 */
async function promptOverwriteDir(dir) {
  const questions = [{
    type: 'confirm',
    name: 'overwriteExistingFolder',
    message: `The folder ${dir} already exists. Are you sure you want to write JSON data into this folder?`
  }];
  const answers = await _inquirer.default.prompt(questions);
  return answers.overwriteExistingFolder;
}