From 7b45e7fa1b02b75f9aff06e22f4a0d7071bf71ae Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Wed, 19 Jul 2023 09:16:43 -0700 Subject: [PATCH] feat(build): trigger rerun if plugin config env var changes (#7458) --- core/tauri-build/src/config.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/tauri-build/src/config.rs b/core/tauri-build/src/config.rs index 2125449e52ed..2bb2631c0d57 100644 --- a/core/tauri-build/src/config.rs +++ b/core/tauri-build/src/config.rs @@ -7,10 +7,12 @@ use serde::de::DeserializeOwned; use std::{env::var, io::Cursor}; pub fn plugin_config(name: &str) -> Option { - if let Ok(config_str) = var(format!( + let config_env_var_name = format!( "TAURI_{}_PLUGIN_CONFIG", name.to_uppercase().replace('-', "_") - )) { + ); + if let Ok(config_str) = var(&config_env_var_name) { + println!("cargo:rerun-if-env-changed={config_env_var_name}"); serde_json::from_reader(Cursor::new(config_str)) .map(Some) .expect("failed to parse configuration")