text: const Manager = require("./lib/Manager");
  const Engineer = require("./lib/Engineer");
  const Intern = require("./lib/Intern");
  const inquirer = require("inquirer");
  const path = require("path");
  const fs = require("fs");
  
  const OUTPUT_DIR = path.resolve(__dirname, "output");
  const outputPath = path.join(OUTPUT_DIR, "team.html");
  
  const render = require("./lib/htmlRenderer");
  
  //GLOBAL VARIABLES
  let employees = [];
  
  //Inquirer Questions
  const generalQuestions = [{
          type: 'input',
          message: "Enter the Employee's name:",
          name: 'name'
      },
      {
          type: 'input',
          message: "Enter the Emloyee's id:",
          name: 'id'
      },
      {
          type: 'input',
          message: "Enter the Employee's email:",
          name: 'email'
  
      }
  ];
  
  const managerQuestion = [{
      type: 'input',
      message: 'What is their office number?',
      name: 'officeNum'
  }]
  
  const engineerQuestion = [{
      type: 'input',
      message: 'What is their Github username?',
      name: 'githubUsername'
  }]
  
  const internQuestion = [{
      type: 'input',
      message: 'What is their school do they attend?',
      name: 'school'
  }]
  
  /* ----- RUN PROGRAM ----- */
  addMemberPrompt();
  
  function addMemberPrompt() {
      inquirer.prompt([{
              type: 'confirm',
              message: 'Would you like to add a team member?',
              name: 'addTeamMember'
          }])
          .then((response) => {
              if (response.addTeamMember) makeNewEmployee();
              else {
                  fs.appendFile(outputPath, render(employees), (err) => {
                      if (err) throw err;
                      console.log('The "data to append" was appended to file!');
                    });
              }
          });
  }
  
  function makeNewEmployee() {
      inquirer.prompt([{
              type: 'list',
              message: 'What type of team member are you adding?',
              choices: ['Manager', 'Engineer', 'Intern'],
              name: 'employeeType'
          }])
          .then((response) => getEmployeeInfo(response.employeeType));
  }
  
  function getEmployeeInfo(employeeType) {
      inquirer.prompt(generalQuestions).then((res) => {
          if (employeeType === 'Manager') {
              inquirer.prompt(managerQuestion)
                  .then((data) => {
                      employees.push(new Manager(res.name, res.id, res.email, data.officeNum));    
                      addMemberPrompt();             
                  });
          } else if (employeeType === 'Engineer') {
              inquirer.prompt(engineerQuestion)
                  .then((data) => {
                      employees.push(new Engineer(res.name, res.id, res.email, data.githubUsername)); 
                      addMemberPrompt();   
                  });
          } else {
              inquirer.prompt(internQuestion)
                  .then((data) => {
                      employees.push(new Intern(res.name, res.id, res.email, data.school));
                      addMemberPrompt();     
                  });
          }
      })
  }
  
  // Write code to use inquirer to gather information about the development team members,
  // and to create objects for each team member (using the correct classes as blueprints!)
  
  // After the user has input all employees desired, call the `render` function (required
  // above) and pass in an array containing all employee objects; the `render` function will
  // generate and return a block of HTML including templated divs for each employee!
  
  // After you have your html, you're now ready to create an HTML file using the HTML
  // returned from the `render` function. Now write it to a file named `team.html` in the
  // `output` folder. You can use the variable `outputPath` above target this location.
  // Hint: you may need to check if the `output` folder exists and create it if it
  // does not.
  
  // HINT: each employee type (manager, engineer, or intern) has slightly different
  // information; write your code to ask different questions via inquirer depending on
  // employee type.
  
  // HINT: make sure to build out your classes first! Remember that your Manager, Engineer,
  // and Intern classes should all extend from a class named Employee; see the directions
  // for further information. Be sure to test out each class and verify it generates an
  // object with the correct structure and methods. This structure will be crucial in order
  // for the provided `render` function to work! ```