diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-07-17 21:58:11 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-07-17 21:58:11 -0400 |
commit | 4385f6eb523ece963b154f2525f82e8e9f3882f1 (patch) | |
tree | 1c9d5e9670bac39730e93426e55cdb92f675937c /src/config | |
parent | df08a9916d2dc84f77cf8adbf86d37af0b1ad7e2 (diff) |
add tilde expansion to preview script path
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/default/preview.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config/default/preview.rs b/src/config/default/preview.rs index 2fd3323..5d9436f 100644 --- a/src/config/default/preview.rs +++ b/src/config/default/preview.rs @@ -32,7 +32,11 @@ impl std::default::Default for PreviewRawOption { impl Flattenable<PreviewOption> for PreviewRawOption { fn flatten(self) -> PreviewOption { let preview_script = match self.preview_script { - Some(s) => Some(path::PathBuf::from(s)), + Some(s) => { + let tilde_cow = shellexpand::tilde_with_context(s.as_str(), dirs_next::home_dir); + let tilde_path = path::PathBuf::from(tilde_cow.as_ref()); + Some(tilde_path) + } None => search_directories("preview.sh", &CONFIG_HIERARCHY), }; |