diff options
Diffstat (limited to 'src/verb/exec_pattern.rs')
-rw-r--r-- | src/verb/exec_pattern.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/verb/exec_pattern.rs b/src/verb/exec_pattern.rs index 774df34..25b0ee2 100644 --- a/src/verb/exec_pattern.rs +++ b/src/verb/exec_pattern.rs @@ -1,5 +1,6 @@ use { crate::{ + path::*, verb::*, }, serde::Deserialize, @@ -103,11 +104,19 @@ impl ExecPattern { } fn fix_token_path<T: Into<String> + AsRef<str>>(token: T) -> String { + //let s = token.as_ref(); let path = Path::new(token.as_ref()); if path.exists() { if let Some(path) = path.to_str() { return path.to_string(); } + } else if TILDE_REGEX.is_match(token.as_ref()) { + let path = untilde(token.as_ref()); + if path.exists() { + if let Some(path) = path.to_str() { + return path.to_string(); + } + } } token.into() } |