Replace type command with which

This commit is contained in:
kramo
2023-09-21 16:26:05 +02:00
parent ea5617518b
commit a8b1791d8f

View File

@@ -169,9 +169,7 @@ class DesktopSourceIterable(SourceIterable):
for command, full_path in commands:
# Even if `gio` is available, `gio launch` is only available on GLib >= 2.67.2
check_command = (
"gio help launch"
if command == "gio launch"
else f"type {command} &> /dev/null"
"gio help launch" if command == "gio launch" else f"which {command}"
)
if os.getenv("FLATPAK_ID") == shared.APP_ID:
check_command = flatpak_str + shlex.quote(check_command)