Touch up extension DAP schemas fix (#33548)
Updates #33546 Release Notes: - N/A Co-authored-by: Piotr <piotr@zed.dev>
This commit is contained in:
parent
14bb10d783
commit
f12b0dddf4
1 changed files with 8 additions and 5 deletions
|
@ -260,17 +260,20 @@ async fn copy_extension_resources(
|
|||
}
|
||||
|
||||
if !manifest.debug_adapters.is_empty() {
|
||||
let output_debug_adapter_schemas_dir = output_dir.join("debug_adapter_schemas");
|
||||
fs::create_dir_all(&output_debug_adapter_schemas_dir)?;
|
||||
for (debug_adapter, entry) in &manifest.debug_adapters {
|
||||
let schema_path = entry.schema_path.clone().unwrap_or_else(|| {
|
||||
PathBuf::from("debug_adapter_schemas".to_owned())
|
||||
.join(format!("{debug_adapter}.json"))
|
||||
.join(debug_adapter.as_ref())
|
||||
.with_extension("json")
|
||||
});
|
||||
let parent = schema_path
|
||||
.parent()
|
||||
.with_context(|| format!("invalid empty schema path for {debug_adapter}"))?;
|
||||
fs::create_dir_all(output_dir.join(parent))?;
|
||||
copy_recursive(
|
||||
fs.as_ref(),
|
||||
&extension_path.join(schema_path.clone()),
|
||||
&output_debug_adapter_schemas_dir.join(format!("{debug_adapter}.json")),
|
||||
&extension_path.join(&schema_path),
|
||||
&output_dir.join(&schema_path),
|
||||
CopyOptions {
|
||||
overwrite: true,
|
||||
ignore_if_exists: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue