From a394735fa920ecf16d77c026ff9fe21edf304a7e Mon Sep 17 00:00:00 2001 From: winston Date: Fri, 17 Mar 2023 06:36:13 +0100 Subject: [PATCH] fix: rewrite `.` when fetching path in lua plugin crate Closes #3194 --- lua-api-crates/plugin/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lua-api-crates/plugin/src/lib.rs b/lua-api-crates/plugin/src/lib.rs index e080c5f43..92c63cc5d 100644 --- a/lua-api-crates/plugin/src/lib.rs +++ b/lua-api-crates/plugin/src/lib.rs @@ -26,7 +26,10 @@ fn compute_repo_dir(url: &str) -> String { ':' => { dir.push_str("sCs"); } - '.' | '-' | '_' => dir.push(c), + '.' => { + dir.push_str("sDs"); + } + '-' | '_' => dir.push(c), c if c.is_alphanumeric() => dir.push(c), c => dir.push_str(&format!("u{}", c as u32)), } @@ -244,8 +247,8 @@ mod test { for (input, expect) in &[ ("foo", "foo"), ( - "github.com/wez/wezterm-plugins", - "github.comsZswezsZswezterm-plugins", + "githubsDscom/wez/wezterm-plugins", + "githubsDscomsZswezsZswezterm-plugins", ), ("localhost:8080/repo", "localhostsCs8080sZsrepo"), ] {