Skip to content

Commit

Permalink
Hardcode separator in generated C++ mapping to '/'
Browse files Browse the repository at this point in the history
it should not be operating system dependent because it is
hardcoded to '/' in the C++ file that performs the lookup

Signed-off-by: Bi0T1N <[email protected]>
  • Loading branch information
Bi0T1N committed Mar 18, 2022
1 parent ba62322 commit df97b05
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdf/embedSdf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from pathlib import Path
from pathlib import Path, PurePosixPath

""""Script for generating a C++ file that contains the content from all SDF files"""

Expand Down Expand Up @@ -94,7 +94,9 @@ def get_map_content(arg_pathlist: Path) -> str:
map_str = ''
files = []
for path in pathlist:
files.append(str(path))
# dir separator is hardcoded to '/' in C++ mapping
posix_path = PurePosixPath(path)
files.append(str(posix_path))
# get ascending order
files.sort()
for file in files:
Expand Down

0 comments on commit df97b05

Please sign in to comment.