findRootDirectory function

String findRootDirectory(
  1. String currentPath
)

Find root directory of this project

Implementation

String findRootDirectory(String currentPath) {
  while (!File(path.join(currentPath, 'pubspec.yaml')).existsSync()) {
    currentPath = path.dirname(currentPath);
  }
  return currentPath;
}