Skip to content

Commit

Permalink
Fix: Do not overwrite args.target on Windows if value is set
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tsukasa committed May 13, 2024
1 parent 524af57 commit 893dc60
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 893dc60

Please sign in to comment.