From bf2635ab6241a5b82569eafc939046d6e245f3ad Mon Sep 17 00:00:00 2001 From: Oscar Beaumont Date: Thu, 2 May 2024 05:40:31 +0800 Subject: [PATCH] fix(plugin): improve error for missing `links` property (#9632) * Better error * Improve errors --- .changes/improve-errors-for-missing-links-property.md | 6 ++++++ core/tauri-plugin/src/build/mod.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/improve-errors-for-missing-links-property.md diff --git a/.changes/improve-errors-for-missing-links-property.md b/.changes/improve-errors-for-missing-links-property.md new file mode 100644 index 000000000..24a59a46d --- /dev/null +++ b/.changes/improve-errors-for-missing-links-property.md @@ -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. + diff --git a/core/tauri-plugin/src/build/mod.rs b/core/tauri-plugin/src/build/mod.rs index 559fd78b4..8587c894f 100644 --- a/core/tauri-plugin/src/build/mod.rs +++ b/core/tauri-plugin/src/build/mod.rs @@ -97,7 +97,7 @@ impl<'a> Builder<'a> { let out_dir = PathBuf::from(build_var("OUT_DIR")?); // 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 commands_dir = autogenerated.join("commands");