Skip to content

fix: Fix path escaping issue in metadata parser - #2605

Merged
Brooooooklyn merged 2 commits into
napi-rs:mainfrom
inakineitor:patch-1
May 6, 2025
Merged

Brooooooklyn merged 2 commits into
napi-rs:mainfrom
inakineitor:patch-1

Conversation

@inakineitor

@inakineitor inakineitor commented May 5, 2025 •

Copy link
Copy Markdown
Contributor

The way the cargo metadata command is currently run is prone to failure because the path is not escaped. The best way to handle this is to pass the arguments directly as separate to the cargo process through spawnSync so there is no need to rely on manual escaping.

Please let me know if there is anything else I should edit before this can be merged!

I am currently using NAPI v3 so I can also put in the work to get it merged to that version following your guidance.

Here is an example of what happens when the project is run in a path that has a space in the name of a folder.
image

@inakineitor

Copy link
Copy Markdown
Contributor Author

@Brooooooklyn Do you know if these two tests are failing from the changes or if they are flaky?

@Brooooooklyn
Brooooooklyn merged commit 7010f60 into napi-rs:main May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants