fix(plugin): improve error for missing links property (#9632)

* Better error

* Improve errors
This commit is contained in:
Oscar Beaumont 2024-05-02 05:40:31 +08:00 committed by GitHub
parent cd5580749c
commit bf2635ab62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
'tauri-plugin': patch:enhance
---
Improve the error message that is shown when the `links` property is missing from a Tauri Plugin.

View File

@ -97,7 +97,7 @@ impl<'a> Builder<'a> {
let out_dir = PathBuf::from(build_var("OUT_DIR")?); let out_dir = PathBuf::from(build_var("OUT_DIR")?);
// requirement: links MUST be set and MUST match the name // requirement: links MUST be set and MUST match the name
let _links = build_var("CARGO_MANIFEST_LINKS")?; let _links = std::env::var("CARGO_MANIFEST_LINKS").map_err(|_| Error::LinksMissing)?;
let autogenerated = Path::new("permissions").join(acl::build::AUTOGENERATED_FOLDER_NAME); let autogenerated = Path::new("permissions").join(acl::build::AUTOGENERATED_FOLDER_NAME);
let commands_dir = autogenerated.join("commands"); let commands_dir = autogenerated.join("commands");