From 1dfe472a5789970d83d98dc5f0667f5bde0aa315 Mon Sep 17 00:00:00 2001 From: Patrick Marsee Date: Mon, 30 Jan 2023 23:56:49 -0500 Subject: [PATCH] Fixed crash when arguments ending with a slash are given to enable, disable, and toggle. --- seven_mods.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/seven_mods.py b/seven_mods.py index 10996fe..7484c58 100755 --- a/seven_mods.py +++ b/seven_mods.py @@ -314,6 +314,7 @@ def command_list(args: list, cfg: Config, profiles: ModProfiles): print(f"Usage: {args[0]} {args[1]} [profiles]") def command_enable(args: list, cfg: Config, profiles: ModProfiles): + args = [a.rstrip("/") for a in args] for mod in args[2:]: if not mod in ("-a", "-A", "*"): enable_mod(cfg, mod) @@ -326,6 +327,7 @@ def command_enable(args: list, cfg: Config, profiles: ModProfiles): break def command_disable(args: list, cfg: Config, profiles: ModProfiles): + args = [a.rstrip("/") for a in args] for mod in args[2:]: if not mod in ("-a", "-A", "*"): disable_mod(cfg, mod) @@ -336,6 +338,7 @@ def command_disable(args: list, cfg: Config, profiles: ModProfiles): break def command_toggle(args: list, cfg: Config, profiles: ModProfiles): + args = [a.rstrip("/") for a in args] for mod in args[2:]: toggle_mod(cfg, mod)