whichSync function
Find the command according to the paths
or env variables (PATH
)
Implementation
String? whichSync(String command,
{@Deprecated('Use environment') Map<String, String>? env,
Map<String, String>? environment,
bool includeParentEnvironment = true}) {
// only valid for single commands
if (basename(command) != command) {
return null;
}
// Merge system environment
var shellEnvironment = ShellEnvironment.full(
environment: environment,
includeParentEnvironment: includeParentEnvironment);
return shellEnvironment.whichSync(command);
}