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