isOnPATH method

bool isOnPATH(
  1. String checkPath
)

returns true if the given checkPath is in the list of paths defined in the environment variable PATH.

Implementation

bool isOnPATH(String checkPath) {
  final canon = truepath(checkPath);
  var found = false;
  for (final path in _path) {
    if (truepath(path) == canon) {
      found = true;
      break;
    }
  }
  return found;
}