Skip to content

Commit

Permalink
This partially addresses #1321 because it only fixes the issue in cmd…
Browse files Browse the repository at this point in the history
… shell.

Signed-off-by: javrin <jawabiscuit@users.noreply.github.com>
  • Loading branch information
Jawabiscuit committed Sep 15, 2023
1 parent 3da8f11 commit ac3ff37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rezplugins/shell/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ def normalize_path(self, path):
This isn't explicitely necessary on Windows since around Windows 7,
CMD has supported mixed slashes as a path separator. However,
we can still call this method to normalize paths for consistency.
we can still call this method to normalize paths for consistency and
have better interoperability with some software such as cmake which
prefer forward slashes e.g. GH issue #1321.
Args:
path (str): Path to normalize.
Expand All @@ -292,7 +294,8 @@ def normalize_path(self, path):
if not config.enable_path_normalization:
return path

normalized_path = path.replace("/", "\\")
path = os.path.normpath(path)
normalized_path = path.replace("\\", "/")

if path != normalized_path:
log("CMD normalize_path()")
Expand Down

0 comments on commit ac3ff37

Please sign in to comment.