mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Strip 'Cargo.toml' from workspace path for patches (#1391)
This commit is contained in:
@@ -120,6 +120,9 @@ fn add_patches(project_toml: &mut Table) {
|
|||||||
)
|
)
|
||||||
.expect("Workspace root `Cargo.toml` is a valid toml file; qed");
|
.expect("Workspace root `Cargo.toml` is a valid toml file; qed");
|
||||||
|
|
||||||
|
let mut workspace_path = workspace_toml_path;
|
||||||
|
workspace_path.pop();
|
||||||
|
|
||||||
while let Some(mut patch) =
|
while let Some(mut patch) =
|
||||||
workspace_toml.remove("patch").and_then(|p| p.try_into::<Table>().ok())
|
workspace_toml.remove("patch").and_then(|p| p.try_into::<Table>().ok())
|
||||||
{
|
{
|
||||||
@@ -134,7 +137,7 @@ fn add_patches(project_toml: &mut Table) {
|
|||||||
p.iter_mut().filter(|(k, _)| k == &"path").for_each(|(_, v)| {
|
p.iter_mut().filter(|(k, _)| k == &"path").for_each(|(_, v)| {
|
||||||
if let Some(path) = v.as_str().map(PathBuf::from) {
|
if let Some(path) = v.as_str().map(PathBuf::from) {
|
||||||
if path.is_relative() {
|
if path.is_relative() {
|
||||||
*v = workspace_toml_path.join(path).display().to_string().into();
|
*v = workspace_path.join(path).display().to_string().into();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user