diff --git a/Cargo.lock b/Cargo.lock index 7427528..832ce1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -623,11 +623,11 @@ dependencies = [ [[package]] name = "git2" -version = "0.17.2" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" +checksum = "1b3ba52851e73b46a4c3df1d89343741112003f0f6f13beb0dfac9e457c3fdcd" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "libc", "libgit2-sys", "log", @@ -1048,15 +1048,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.148" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libgit2-sys" -version = "0.15.2+1.6.4" +version = "0.16.2+1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index c759857..122a1b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ anyhow = "1.0.75" gettext-rs = { version = "0.7.0", features = [ "gettext-system" ] } -git2 = "0.17.2" +git2 = "0.18.2" gtk4 = { version = "0.7.2", features = [ "v4_10", ] } diff --git a/src/ui/profile_editor.rs b/src/ui/profile_editor.rs index 2db7dbc..1d8f856 100644 --- a/src/ui/profile_editor.rs +++ b/src/ui/profile_editor.rs @@ -404,13 +404,22 @@ impl SimpleComponent for ProfileEditor { self.xrservice_cmake_flags_rows.guard().remove(p); } } - Self::Input::AddEnvVar(name) => { + Self::Input::AddEnvVar(var) => { let mut prof = self.profile.borrow_mut(); - if !prof.environment.contains_key(&name) { - prof.environment.insert(name.clone(), "".to_string()); + if !prof.environment.contains_key(&var) { + let (name, value) = if var.contains('=') { + let mut sp = var.split('='); + ( + sp.next().unwrap().to_string(), + sp.next().unwrap().to_string(), + ) + } else { + (var, "".to_string()) + }; + prof.environment.insert(name.clone(), value.clone()); self.env_rows.guard().push_back(EnvVarModelInit { name, - value: "".to_string(), + value, var_type: VarType::EnvVar, }); }