From 1f263c7124f0d37f79255516f0a38b04560ce3fa Mon Sep 17 00:00:00 2001 From: Brett Williams Date: Sun, 4 Jun 2023 13:05:30 -0500 Subject: [PATCH] Fix the multi-platform check --- lib/utilities/misc_helper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/utilities/misc_helper.py b/lib/utilities/misc_helper.py index 904c754..9fade18 100644 --- a/lib/utilities/misc_helper.py +++ b/lib/utilities/misc_helper.py @@ -5,11 +5,11 @@ logger = logging.getLogger() def launch_url(url): - if subprocess.check_output(['which', 'open']): - subprocess.run(['open', url]) # macos - elif subprocess.check_output(['which', 'xdg-open']): + if subprocess.run(['which', 'xdg-open'], capture_output=True).returncode == 0: subprocess.run(['xdg-open', url]) # linux - elif subprocess.check_output(['which', 'start']): + elif subprocess.run(['which', 'open'], capture_output=True).returncode == 0: + subprocess.run(['open', url]) # macos + elif subprocess.run(['which', 'start'], capture_output=True).returncode == 0: subprocess.run(['start', url]) # windows - need to validate this works else: logger.error(f"No valid launchers found to launch url: {url}") \ No newline at end of file