Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions scripts/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,14 @@ def get_relative_path(full_path):
if not full_path or not Context._data_folder:
return full_path

if full_path.startswith(Context._data_folder):
# Strip the base path and any leading separators
return full_path[len(Context._data_folder):].lstrip('/\\')
if Context._data_folder in full_path:
# Strip the base path everywhere it appears, including inside path
# strings concatenated with arbitrary separators (', ', '; ', ...)
base = Context._data_folder
return (full_path.replace(base + '/', '')
.replace(base + '\\', '')
.replace(base, '')
.lstrip('/\\'))

return full_path

Expand Down