def read_from_disk
      return {} if !File.file?(answer_file_path) || File.zero?(answer_file_path)

      unless File.readable?(answer_file_path)
        raise PDK::CLI::FatalError, _("Unable to open '%{file}' for reading") % {
          file: answer_file_path,
        }
      end

      answers = JSON.parse(File.read(answer_file_path))
      if answers.is_a?(Hash)
        answers
      else
        PDK.logger.warn _("Answer file '%{path}' did not contain a valid set of answers, recreating it") % {
          path: answer_file_path,
        }
        {}
      end
    rescue JSON::JSONError
      PDK.logger.warn _("Answer file '%{path}' did not contain valid JSON, recreating it") % {
        path: answer_file_path,
      }
      {}
    end
def read_from_disk
      return {} if !File.file?(answer_file_path) || File.zero?(answer_file_path)

      unless File.readable?(answer_file_path)
        raise PDK::CLI::FatalError, _("Unable to open '%{file}' for reading") % {
          file: answer_file_path,
        }
      end

      answers = JSON.parse(File.read(answer_file_path))
      if answers.is_a?(Hash)
        answers
      else
        PDK.logger.warn _("Answer file '%{path}' did not contain a valid set of answers, recreating it") % {
          path: answer_file_path,
        }
        {}
      end
    rescue JSON::JSONError
      PDK.logger.warn _("Answer file '%{path}' did not contain valid JSON, recreating it") % {
        path: answer_file_path,
      }
      {}
    end
Read existing answers into memory from the answer file on disk.

 @raise [PDK::CLI::FatalError] If the answer file exists but can not be
   read.

 @return [Hash{String => Object}] The existing questions and answers.