From 75d57fca7fd08c758090c3e938f16eb4358545a1 Mon Sep 17 00:00:00 2001 From: wunderwuzzi23 Date: Sat, 11 Mar 2023 15:24:43 -0800 Subject: [PATCH] Support FreeBSD, simplify some error logic --- yolo.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/yolo.py b/yolo.py index b40bbfe..4b1518b 100755 --- a/yolo.py +++ b/yolo.py @@ -61,11 +61,13 @@ def get_os_friendly_name(): os_name = platform.system() if os_name == "Linux": - return "Linux/"+distro.name(pretty=True) + return "Linux/"+distro.name(pretty=True) elif os_name == "Windows": - return os_name + return os_name elif os_name == "Darwin": - return "Darwin/macOS" + return "Darwin/macOS" + else: + return os_name if __name__ == "__main__": @@ -141,7 +143,8 @@ res_command = response.choices[0].message.content.strip() #Enable color output on Windows using colorama init() -if res_command.startswith("Sorry, try again") or res_command.startswith("I'm sorry"): +prefixes = ("Sorry", "I'm sorry") +if res_command.startswith(prefixes): print(colored("There was an issue: "+res_command, 'red')) sys.exit(-1)