fix(build): fix writing schema file (#8782)

* fix(build): fix writing schema file

* Update .changes/schema_str.md
This commit is contained in:
Amr Bashir 2024-02-05 19:32:27 +02:00 committed by GitHub
parent f2e4c9de3a
commit 19fb5f0b20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

5
.changes/schema_str.md Normal file
View File

@ -0,0 +1,5 @@
---
'tauri-build': 'patch:bug'
---
Fix generating invalid schema files.

View File

@ -181,7 +181,7 @@ pub fn generate_schema(
let schema_path = out_dir.join(format!("{target}-{CAPABILITIES_SCHEMA_FILE_NAME}")); let schema_path = out_dir.join(format!("{target}-{CAPABILITIES_SCHEMA_FILE_NAME}"));
if schema_str != read_to_string(&schema_path).unwrap_or_default() { if schema_str != read_to_string(&schema_path).unwrap_or_default() {
write(&schema_path, "{schema_str}")?; write(&schema_path, schema_str)?;
copy( copy(
schema_path, schema_path,