projectDir static method

String projectDir([
  1. String? dir
])

Implementation

static String projectDir([String? dir]) {
  if (dir == null) {
    return p.current;
  }

  var path = p.normalize(dir);
  if (!p.isAbsolute(path)) {
    path = p.join(p.current, path);
  }

  if (Directory(path).existsSync()) {
    return path;
  }
  throw Exception('invalid dir');
}