On Windows, compare paths case-insensitively for the purpose of careful_delete

Fixes #27.
This commit is contained in:
blinry 2021-03-24 15:38:53 +01:00
parent d44c7d0d49
commit b5ca69264a

View file

@ -96,6 +96,9 @@ func careful_delete(path_inside):
expected_prefix = "/Users/%s/Library/Application Support/Oh My Git/tmp/" % OS.get_environment("USER")
elif os == "Windows":
expected_prefix = "C:/Users/%s/AppData/Roaming/Oh My Git/tmp/" % OS.get_environment("USERNAME")
# Windows treats paths case-insensitively:
expected_prefix = expected_prefix.to_lower()
path_inside = path_inside.to_lower()
else:
helpers.crash("Unsupported OS: %s" % os)