mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-29 12:06:01 +02:00
fix(fs): Temp workaround for docs.rs build error (#2171)
* test * test * fix(fs): Temp workaround for docs.rs build error * change
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
fs: patch
|
||||
fs-js: patch
|
||||
---
|
||||
|
||||
Fixed docs.rs build.
|
||||
+22
-10
@@ -208,11 +208,18 @@ permissions = [
|
||||
}
|
||||
}
|
||||
|
||||
tauri_plugin::Builder::new(&COMMANDS.iter().map(|c| c.0).collect::<Vec<_>>())
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.global_scope_schema(schemars::schema_for!(FsScopeEntry))
|
||||
.android_path("android")
|
||||
.build();
|
||||
tauri_plugin::Builder::new(
|
||||
&COMMANDS
|
||||
.iter()
|
||||
// FIXME: https://docs.rs/crate/tauri-plugin-fs/2.1.0/builds/1571296
|
||||
.filter(|c| c.1.is_empty())
|
||||
.map(|c| c.0)
|
||||
.collect::<Vec<_>>(),
|
||||
)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.global_scope_schema(schemars::schema_for!(FsScopeEntry))
|
||||
.android_path("android")
|
||||
.build();
|
||||
|
||||
// workaround to include nested permissions as `tauri_plugin` doesn't support it
|
||||
let permissions_dir = autogenerated.join("commands");
|
||||
@@ -234,9 +241,11 @@ permissions = [
|
||||
.iter_mut()
|
||||
.filter(|p| p.identifier.starts_with("allow"))
|
||||
{
|
||||
p.commands
|
||||
.allow
|
||||
.extend(nested_commands.iter().map(|s| s.to_string()));
|
||||
for c in nested_commands.iter().map(|s| s.to_string()) {
|
||||
if !p.commands.allow.contains(&c) {
|
||||
p.commands.allow.push(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let out = toml::to_string_pretty(&permission_file)
|
||||
@@ -248,7 +257,10 @@ permissions = [
|
||||
|
||||
{out}"#
|
||||
);
|
||||
std::fs::write(permission_path, out)
|
||||
.unwrap_or_else(|_| panic!("failed to write {command}.toml"));
|
||||
|
||||
if content != out {
|
||||
std::fs::write(permission_path, out)
|
||||
.unwrap_or_else(|_| panic!("failed to write {command}.toml"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user