Handle symlinked database files correctly
This commit is contained in:
parent
450433644f
commit
efd49e7f3d
|
@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
`$__fish_data_dir/functions/cd.fish`. This should minimize the chances of an
|
`$__fish_data_dir/functions/cd.fish`. This should minimize the chances of an
|
||||||
infinite loop when aliasing `cd=z`.
|
infinite loop when aliasing `cd=z`.
|
||||||
- Symlinks not getting added to the database when `$_ZO_RESOLVE_SYMLINKS=0`.
|
- Symlinks not getting added to the database when `$_ZO_RESOLVE_SYMLINKS=0`.
|
||||||
|
- Handle symlinked database files correctly.
|
||||||
|
|
||||||
## [0.9.4] - 2024-02-21
|
## [0.9.4] - 2024-02-21
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ impl Database {
|
||||||
pub fn open_dir(data_dir: impl AsRef<Path>) -> Result<Self> {
|
pub fn open_dir(data_dir: impl AsRef<Path>) -> Result<Self> {
|
||||||
let data_dir = data_dir.as_ref();
|
let data_dir = data_dir.as_ref();
|
||||||
let path = data_dir.join("db.zo");
|
let path = data_dir.join("db.zo");
|
||||||
|
let path = fs::canonicalize(&path).unwrap_or(path);
|
||||||
|
|
||||||
match fs::read(&path) {
|
match fs::read(&path) {
|
||||||
Ok(bytes) => Self::try_new(path, bytes, |bytes| Self::deserialize(bytes), false),
|
Ok(bytes) => Self::try_new(path, bytes, |bytes| Self::deserialize(bytes), false),
|
||||||
|
|
Loading…
Reference in New Issue