getPuroPath function

File? getPuroPath()

Implementation

File? getPuroPath() {
  String? path;
  // Try to find puro in PATH
  final which = dcli.which('puro');
  if (which.found) {
    path = which.path;
  }
  if (path == null) {
    final standalonePath = getPuroStandaloneBinPath();
    if (standalonePath.existsSync()) {
      final result = dcli.find(
        'puro',
        workingDirectory: standalonePath.path,
        recursive: false,
      );
      path = result.firstLine;
    }
  }
  return path != null ? File(path) : null;
}