Skip to content

Commit bcb5172

Browse files
authored
Improve obsidian config logic (#45)
#### [Get all potential obsidian global config locations](a5136b1) > Due to the nature of this functionality being reliant of another > application called Obsidian, we must take into account possible > sandboxed installations on Linux systems (e.g. flatpak, snap). > > Additionally, this global config location can be controlled with an > environment variable called `OBSIDIAN_CONFIG_DIR`, which can be given a > `~` symbol to mark the home directory. The `~` symbol is transformed to > the absolute home directory path. > > The obsidian_global_config_locations() returns all potential directory > paths for Obsidian. > > On macOS and Windows we default to the regular paths defined in the > Obsidian documentation: > > - macOS: /Users/username/Library/Application Support/obsidian > - Windows: %APPDATA%\Obsidian\ > > From this list of returned configs we filter out any paths that do not > exist and then we select the first one, as the returned list is in order > of priority: > > 1. The `OBSIDIAN_CONFIG_DIR` environment variable > 2. User config directory > 3. Flatpak config > 4. Snap config > > If no paths can be certainly determined to be directories we fail with > an error that displays all the configs we tried to access. > > This change should fix #44. #### [Use try_exists in load_from for global Obsidian config](9f5359d) > Previously we naively assumed that the config file exists, now a more > explicit domain error is returned. #### [Remove created field from Note as obsolete](fa17bf6) > The existence of this field could result notes from being read into the > program due to the fact that some systems do not support the file > creation time metadata. > > This functionality was now removed, since it was not in use in > basalt-tui. #### [Return Vec instead of Iterator from notes()](d56f252)
2 parents cd99e99 + 6f4c137 commit bcb5172

9 files changed

Lines changed: 161 additions & 156 deletions

File tree

Cargo.lock

Lines changed: 22 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resolver = "2"
44

55
[workspace.dependencies]
66
basalt = { path = "basalt", version = "0.3.1" }
7-
basalt-core = { path = "basalt-core", version = "0.4.3" }
7+
basalt-core = { path = "basalt-core", version = "0.5.0" }
88
basalt-widgets = { path = "basalt-widgets", version = "0.1.1" }
99

1010
[profile.ci]

basalt-core/CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## 0.5.0 (2025-05-25)
4+
5+
### obsidian
6+
7+
#### Breaking
8+
9+
- [Return `Vec` instead of `Iterator` from `notes()`](https://github.com/erikjuhani/basalt/commit/d56f2529971f54e8931f31ed32e2651087050c24)
10+
- [Remove `created` field from Note as obsolete](https://github.com/erikjuhani/basalt/commit/fa17bf67ed13f002b8a97c259c18013a19756907)
11+
12+
#### Changed
13+
14+
- [Use try_exists in load_from for global Obsidian config](https://github.com/erikjuhani/basalt/commit/9f5359ddf38b9b3482f066c3b3bbc3339d4fb2ff)
15+
16+
#### Fixed
17+
18+
- [Get all potential obsidian global config locations](https://github.com/erikjuhani/basalt/commit/a5136b18ea87d00c5ca53bb539910df22582f260)
19+
320
## 0.4.3 (2025-05-21)
421

522
### Fixed

basalt-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Provides the core functionality for Basalt TUI application
66
readme = "README.md"
77
repository = "https://github.com/erikjuhani/basalt"
88
license = "MIT"
9-
version = "0.4.3"
9+
version = "0.5.0"
1010
edition = "2021"
1111

1212
[dependencies]
13-
dirs = "5.0.1"
13+
dirs = "6.0.0"
1414
thiserror = "2.0.11"
1515
serde = { version = "1.0.217", features = ["derive"] }
1616
serde_json = "1.0"

0 commit comments

Comments
 (0)