extension_cli: Copy over snippet file when bundling extensions (#34450)
Closes #30670 Release Notes: - Fixed snippets from extensions not working.
This commit is contained in:
parent
8dca4d150e
commit
52f2b32557
1 changed files with 18 additions and 0 deletions
|
@ -289,6 +289,24 @@ async fn copy_extension_resources(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(snippets_path) = manifest.snippets.as_ref() {
|
||||||
|
let parent = snippets_path.parent();
|
||||||
|
if let Some(parent) = parent.filter(|p| p.components().next().is_some()) {
|
||||||
|
fs::create_dir_all(output_dir.join(parent))?;
|
||||||
|
}
|
||||||
|
copy_recursive(
|
||||||
|
fs.as_ref(),
|
||||||
|
&extension_path.join(&snippets_path),
|
||||||
|
&output_dir.join(&snippets_path),
|
||||||
|
CopyOptions {
|
||||||
|
overwrite: true,
|
||||||
|
ignore_if_exists: false,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.with_context(|| format!("failed to copy snippets from '{}'", snippets_path.display()))?;
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue