Skip to content

Commit 2fb48f1

Browse files
committed
Hardcode separator in generated C++ mapping to '/'
it should not be operating system dependent because it is hardcoded to '/' in the C++ file that performs the lookup
1 parent ba62322 commit 2fb48f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sdf/embedSdf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
from pathlib import Path
2+
from pathlib import Path, PurePosixPath
33

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

@@ -94,7 +94,9 @@ def get_map_content(arg_pathlist: Path) -> str:
9494
map_str = ''
9595
files = []
9696
for path in pathlist:
97-
files.append(str(path))
97+
# dir separator is hardcoded to '/' in C++ mapping
98+
posix_path = PurePosixPath(path)
99+
files.append(str(posix_path))
98100
# get ascending order
99101
files.sort()
100102
for file in files:

0 commit comments

Comments
 (0)