From 1b5fdb6645ce55b90347c746e39acb37fa82d546 Mon Sep 17 00:00:00 2001 From: SteveLauC Date: Fri, 13 Oct 2023 18:54:42 +0800 Subject: [PATCH] fix: shellexpand git.pull_only_repos & git.push_only_repos (#576) --- src/config.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/config.rs b/src/config.rs index 4272c9d0..c8e59f3f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -697,6 +697,22 @@ impl ConfigFile { } } + if let Some(paths) = result.git.as_mut().and_then(|git| git.pull_only_repos.as_mut()) { + for path in paths.iter_mut() { + let expanded = shellexpand::tilde::<&str>(&path.as_ref()).into_owned(); + debug!("Path {} expanded to {}", path, expanded); + *path = expanded; + } + } + + if let Some(paths) = result.git.as_mut().and_then(|git| git.push_only_repos.as_mut()) { + for path in paths.iter_mut() { + let expanded = shellexpand::tilde::<&str>(&path.as_ref()).into_owned(); + debug!("Path {} expanded to {}", path, expanded); + *path = expanded; + } + } + debug!("Loaded configuration: {:?}", result); Ok(result)