mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-11-30 08:23:53 +00:00
Add symlinks to the database
This commit is contained in:
parent
c1d7c4f4c7
commit
450433644f
@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- fish: `cd` command is now copied directly from
|
||||
`$__fish_data_dir/functions/cd.fish`. This should minimize the chances of an
|
||||
infinite loop when aliasing `cd=z`.
|
||||
- Symlinks not getting added to the database when `$_ZO_RESOLVE_SYMLINKS=0`.
|
||||
|
||||
## [0.9.4] - 2024-02-21
|
||||
|
||||
|
@ -83,8 +83,12 @@ impl<'a> Stream<'a> {
|
||||
if !self.options.exists {
|
||||
return true;
|
||||
}
|
||||
|
||||
// The logic here is reversed - if we resolve symlinks when adding entries to
|
||||
// the database, we should not return symlinks when querying back from
|
||||
// the database.
|
||||
let resolver =
|
||||
if self.options.resolve_symlinks { fs::metadata } else { fs::symlink_metadata };
|
||||
if self.options.resolve_symlinks { fs::symlink_metadata } else { fs::metadata };
|
||||
resolver(path).map(|metadata| metadata.is_dir()).unwrap_or_default()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user