fix: permission file uses ':' in file name (#10485)

* fix: permission file uses ':' in file name

* style: rustfmt
This commit is contained in:
anatawa12 2024-08-05 21:45:00 +09:00 committed by GitHub
parent 725dbb7250
commit 7e810cb2a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -0,0 +1,5 @@
---
"tauri-utils": "patch:bug"
---
Fixed an issue where permission files will be generated with ':' in the file path.

View File

@ -71,10 +71,8 @@ pub fn define_permissions<F: Fn(&Path) -> bool>(
.filter(|p| p.parent().unwrap().file_name().unwrap() != PERMISSION_SCHEMAS_FOLDER_NAME)
.collect::<Vec<PathBuf>>();
let permission_files_path = out_dir.join(format!(
"{}-permission-files",
pkg_name.replace("tauri:", "tauri-")
));
let permission_files_path =
out_dir.join(format!("{}-permission-files", pkg_name.replace(':', "-")));
std::fs::write(
&permission_files_path,
serde_json::to_string(&permission_files)?,