Closed maackle closed 5 months ago
This may not be the ideal solution (ideally we select the local package, if there are multiple), but I think this is better than selecting arbitrarily.
This may not be the ideal solution (ideally we select the local package, if there are multiple), but I think this is better than selecting arbitrarily.
We can do better. What we want to do is select the package that is in the workspace. That can be done by checking the package id. The method select_package()
can simply become
metadata.packages.iter().find(|package| {
package.name == package_name && metadata.workspace_members.contains(&package.id)
})
Edit: Can you also squash your commits. No need to have a commit with the test before the fix.
Ah yes that's better. I made that change and reset everything to a single commit.
Thanks for you contribution @maackle. I'll cut a release now.
In situations where multiple version of a package are included as dependencies, cargo-rdme only chooses the first one it finds.
metadata.workspace_members
seems to only list the latest version. This PR updates the package selection to choose the package with the latest version when there are multiple choices.The test in the first commit fails, the second commit fixes it.