mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 08:48:13 +00:00
Fix the multi-platform check
This commit is contained in:
@@ -5,11 +5,11 @@ logger = logging.getLogger()
|
|||||||
|
|
||||||
|
|
||||||
def launch_url(url):
|
def launch_url(url):
|
||||||
if subprocess.check_output(['which', 'open']):
|
if subprocess.run(['which', 'xdg-open'], capture_output=True).returncode == 0:
|
||||||
subprocess.run(['open', url]) # macos
|
|
||||||
elif subprocess.check_output(['which', 'xdg-open']):
|
|
||||||
subprocess.run(['xdg-open', url]) # linux
|
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
|
subprocess.run(['start', url]) # windows - need to validate this works
|
||||||
else:
|
else:
|
||||||
logger.error(f"No valid launchers found to launch url: {url}")
|
logger.error(f"No valid launchers found to launch url: {url}")
|
||||||
Reference in New Issue
Block a user