Skip to content

Commit

Permalink
Fix path logic
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
  • Loading branch information
mjcarroll committed Aug 10, 2023
1 parent 0f6044a commit c9a1b85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ genrule(
"sdf/**/*.convert",
]),
outs = ["EmbeddedSdf.cc"],
cmd = "$(execpath :embed_sdf) --output-file $@ --sdf-root ./sdformat/sdf --input-files $(SRCS)", # noqa
cmd = "$(execpath :embed_sdf) --output-file $@ --sdf-root sdformat/sdf --input-files $(SRCS)", # noqa
tools = [":embed_sdf"],
)

Expand Down
4 changes: 2 additions & 2 deletions sdf/embedSdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ def generate_map_content(paths: List[Path], relative_to: Optional[str] = None) -
for path in paths:
with open(path, "r", encoding="utf8") as input_sdf:
file_content = input_sdf.read()

# Strip relative path if requested
if relative_to is not None:
path = path.relative_to(relative_to)
_, relative_path = str(path).split(relative_to)
path = relative_path
content.append(embed_sdf_content(str(path), file_content))
return ",".join(content)

Expand Down

0 comments on commit c9a1b85

Please sign in to comment.