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");
  const employeeListArray = [];
  
  // 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!)
  function managerInfo() {
      inquirer.prompt([
          {
              type: 'imput',
              name: 'name',
              message: "Welcome manager, please enter your name here"
          },
          {
              type: 'input',
              name: 'id',
              message: "Please enter your id"
          },
          {
              type: 'input',
              name: 'email',
              message: "Please enter your email"
          },
          {
              type: 'input',
              name: 'officeNumber',
              message: "Please enter your office number"
          }
          ])
          .then((response)=> {
              let managerInfo = new Manager(response.name, response.id, response.email, response.officeNumber);
              employeeListArray.push(managerInfo);
              addNext();
          })
  }
  function addNext() {
      inquirer.prompt([
          {
              type: 'list',
              name: 'nextRole',
              message: "Which type of team member would you like to add?",
              choices: [
                  'Engineer',
                  'Intern',
                  'I am done adding new members'
              ]
          }
      ])
      .then((response=> {
          if(response.nextRole === 'I am done adding new members') {
              let htmlRenderEmployee = render(employeeListArray);
              writeHTMLFile(htmlRenderEmployee);
          }
          else {
              addNextInfo(response.nextRole);
          }
      }
      ))
  }
  
  function addNextInfo(roleName) {
      inquirer.prompt([
          {
              type: 'input',
              name: 'name',
              message: `Please enter ${roleName}'s name`
          },
          {
              type: 'input',
              name: 'id',
              message: `Please enter ${roleName}'s id`
          },
          {
              type: 'input',
              name: 'email',
              message: `Please enter ${roleName}'s email`
          },
          {
              type: 'input',
              name: 'github',
              message: `Please enter ${roleName}'s github username`,
              when: roleName == 'Engineer'
          },
          {
              type: 'input',
              name: 'school',
              message: `Please enter ${roleName}'s school name`,
              when: roleName == 'Intern'
          }
      ])
      .then((response)=> {
          switch (roleName) {
              case 'Engineer':
                  let EngInfo = new Engineer(response.name, response.id, response.email, response.officeNumber);
                  employeeListArray.push(EngInfo); 
                  break;
                  default:
                  let IntInfo = new Intern(response.name, response.id, response.email, response.school);
                  employeeListArray.push(IntInfo);    
          }
          addNext();
      })
  }
  
  function writeHTMLFile(UpdatedHTML) {
      if(!fs.existsSync(OUTPUT_DIR)) {
          fs.mkdir(OUTPUT_DIR,(err) => err ? console.log(error):console.log("New output folder successfully created"));
      }
      fs.writeFile(outputPath,UpdatedHTML,(err) => err? console.log(err):console.log("File sucessfully writen!"));
  }
  managerInfo();
  // 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! ```
  