Laerinok / VS_ModsUpdater

Easily update your favorite mods
MIT License
2 stars 3 forks source link

HOME resolution is broken #41

Open duck-rh opened 6 months ago

duck-rh commented 6 months ago

Quack,

After switching to 1.4.0, updating requirements, adding the new parameter etc, the script was stopping without doing anything. I found the problem was my path in path_mods was broken, containing my username twice (/home/duck/duck/…). Btw the script stops there without saying anything when if path_mods.is_dir(): is false and it is a tad confusing.

In the end the problem is when trying to resolve the HOME variable caused by the re.IGNORECASE flag. When /home/user or ~/ (as Path resolves it) is used the lowercase home is replaced by the content of HOME and that breaks the path, which is not a directory anymore and the script stops.

I guess this flag is needed on windows so you might need to add another variable for that.

Anyway, thanks for making this script, it's very useful.

Regards. \_o<

Laerinok commented 6 months ago

Hello, Thanks for your feedback. I will have a look soon. The argparse module does not use system variable. So I tried to make a small tweak. Indeed I had also this issue of double user on Windows, but after fixed it and tried on both system I did not notice anything. But as I am a very occasional linux user I should miss something.

Thanks again.

duck-rh commented 6 months ago

I looked into it and would suggest using expanduser() provided by Path's pathlib that you are already using.