diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | resources/default-conf/verbs.hjson | 2 | ||||
-rw-r--r-- | src/verb/exec_pattern.rs | 9 |
3 files changed, 11 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0216fde..0ca33b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - `:trash` internal - I'd like feedback on this one - Fix #799 - solve symlinks on `:panel_right` to display the dest path and the dest filesystem - Fix #804 - `:panel_right` on a directory now removes the filter +- more '~' expansion in verb arguments ### v1.29.0 - 2023-11-22 <a name="v1.29.0"></a> diff --git a/resources/default-conf/verbs.hjson b/resources/default-conf/verbs.hjson index 2191040..a7a9c78 100644 --- a/resources/default-conf/verbs.hjson +++ b/resources/default-conf/verbs.hjson @@ -81,7 +81,7 @@ verbs: [ # trash, you may use the ':trash' internal with the verb below: # { # invocation: "rm" - # internal: "trash {file}" + # internal: "trash" # leave_broot: false # } 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() } |