getAndCheckIfLibsDirectoryExists method

Directory getAndCheckIfLibsDirectoryExists(
  1. String libsFolderName
)

Ensures the specified libsFolderName directory exists and returns it.

Throws a LibraryFolderNotFoundException if the directory does not exist.

Returns the Directory representing the lib/ folder.

Implementation

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

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