mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix: remove \\r from schema files on windows (#14561)
This commit is contained in:
5
.changes/schema-carriage-return.md
Normal file
5
.changes/schema-carriage-return.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
tauri-utils: patch:bug
|
||||
---
|
||||
|
||||
Fixed an issue that caused schema files to have `\r` characters on Windows.
|
||||
@@ -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)?;
|
||||
|
||||
@@ -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()))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user