Added hyphen support

This commit is contained in:
Benjamyn Love 2024-12-05 19:14:11 +11:00
parent 567c2944d4
commit 91e595157c

View File

@ -23,7 +23,7 @@ pub fn untildify(input_path: &str) -> String {
return match get_host_dir() { return match get_host_dir() {
Some(path) => { Some(path) => {
let host_dir = path.to_str().unwrap(); let host_dir = path.to_str().unwrap();
let re = Regex::new(r"^~([/\w.]+)").unwrap(); let re = Regex::new(r"^~([/\w.-]+)").unwrap();
match re.captures(input_path) { match re.captures(input_path) {
Some(captures) => { Some(captures) => {
return format!("{}{}", host_dir, &captures[1]); return format!("{}{}", host_dir, &captures[1]);