From 893dc6073ddf8ad7780349facea3e3b208b4f304 Mon Sep 17 00:00:00 2001 From: tsukasa <102845+tsukasa@users.noreply.github.com> Date: Mon, 13 May 2024 18:04:04 +0200 Subject: [PATCH] Fix: Do not overwrite args.target on Windows if value is set Fixes the unexpected behaviour on Windows that causes the args.target to always be overwritten. This effectively disables the --target argument on Windows, thus requiring manual edits to the constants to change the target destination path. This commit also changes the default behaviour on non-Windows systems, so that default values are no longer being strictly enforced when additional or explicit parameter values have been given for the --target argument. --- install.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install.py b/install.py index e612c2b..55a7078 100755 --- a/install.py +++ b/install.py @@ -263,12 +263,15 @@ def dev_reload(target: Path): parser.add_argument("-d", "--dev", action = "store_true", help = "Dev Mode") parser.add_argument("-e", "--extras", nargs = "+", action = "extend", help = "Enable one or multiple theme extras") parser.add_argument("-l", "--list-options", action = "store_true", help = "List available themes & extras and exit") - parser.add_argument("-t", "--target", nargs = "+", action = "extend", default = ["normal", "flatpak"], help = "Install targets: 'normal', 'flatpak', custom paths") + parser.add_argument("-t", "--target", nargs = "+", action = "extend", help = "Install targets: 'normal', 'flatpak', custom paths") parser.add_argument("-u", "--uninstall", action = "store_true", help = "Uninstall theme") args = parser.parse_args() - if WINDOWS_RUN: - args.target = ["windows"] + if args.target is None: + args.target = ["normal", "flatpak"] + + if WINDOWS_RUN: + args.target = ["windows"] if args.list_options: list_options("color themes", find_color_themes(), ".css", colorthemedir, "color-theme")