A function to resolve a command based on the provided command string and directory path, returning the first matching command.
A function to resolve a command based on the provided command string and directory path, returning the first matching command.