fix: rewrite . when fetching path in lua plugin crate

Closes #3194
This commit is contained in:
winston authored and Wez Furlong committed 2023-03-17 11:57:30 -07:00
1 parent 761bd5a4d4
commit a394735fa9
1 file changed
+6 -3
+6 -3
View File
@@ -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"),
] {