Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/schema-carriage-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
tauri-utils: patch:bug
---

Fixed an issue that caused schema files to have `\r` characters on Windows.
6 changes: 6 additions & 0 deletions crates/tauri-utils/src/acl/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ pub fn generate_capability_schema(
extend_permission_entry_schema(&mut schema, acl);

let schema_str = serde_json::to_string_pretty(&schema).unwrap();
// FIXME: in schemars@v1 this doesn't seem to be necessary anymore. If it is, find a better solution.
let schema_str = schema_str.replace("\\r\\n", "\\n");

let out_dir = PathBuf::from(CAPABILITIES_SCHEMA_FOLDER_PATH);
fs::create_dir_all(&out_dir)?;

Expand Down Expand Up @@ -389,6 +392,9 @@ pub fn generate_permissions_schema<P: AsRef<Path>>(

let schema_str = serde_json::to_string_pretty(&schema)?;

// FIXME: in schemars@v1 this doesn't seem to be necessary anymore. If it is, find a better solution.
let schema_str = schema_str.replace("\\r\\n", "\\n");

let out_dir = out_dir.as_ref().join(PERMISSION_SCHEMAS_FOLDER_NAME);
fs::create_dir_all(&out_dir).map_err(|e| Error::CreateDir(e, out_dir.clone()))?;

Expand Down