getAndCheckIfLibsDirectoryExists method

Directory getAndCheckIfLibsDirectoryExists(
  1. String libsFolderName
)

Ensures the specified libsFolderName directory exists and returns it.

If the directory does not exist, logs an error message via LoggerHelper.

Returns the Directory representing the lib/ folder. Throws a LibraryFolderNotFoundException if the lib folder is not available.

Implementation

Directory getAndCheckIfLibsDirectoryExists(String libsFolderName) {
  final projectDirectory = Directory(libsFolderName);

  if (!projectDirectory.existsSync()) {
    throw LibraryFolderNotFoundException();
  }
  return projectDirectory;
}