whichSync function

String whichSync(
  1. String command,
  2. {@deprecated Map<String, String> env,
  3. Map<String, String> environment}
)

Find the command according to the paths or env variables (PATH)

Implementation

String whichSync(String command,
    {@deprecated Map<String, String> env, Map<String, String> environment}) {
  // only valid for single commands
  if (basename(command) != command) {
    return null;
  }
  return findExecutableSync(
      command,
      getUserPaths(environment ??
          // ignore: deprecated_member_use, deprecated_member_use_from_same_package
          env));
}