feat(core): wire up path resolution package

This commit is contained in:
Federico Terzi 2021-03-27 14:35:05 +01:00
parent c4ba7411c1
commit b375518730
4 changed files with 38 additions and 1 deletions

33
Cargo.lock generated
View File

@ -196,6 +196,26 @@ dependencies = [
"winapi",
]
[[package]]
name = "dirs"
version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "142995ed02755914747cc6ca76fc7e4583cd18578746716d0508ea6ed558b9ff"
dependencies = [
"dirs-sys",
]
[[package]]
name = "dirs-sys"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a"
dependencies = [
"libc",
"redox_users",
"winapi",
]
[[package]]
name = "dtoa"
version = "0.4.7"
@ -236,6 +256,7 @@ dependencies = [
"espanso-info",
"espanso-inject",
"espanso-match",
"espanso-path",
"espanso-ui",
"maplit",
"simplelog",
@ -345,6 +366,16 @@ dependencies = [
"unicase",
]
[[package]]
name = "espanso-path"
version = "0.1.0"
dependencies = [
"anyhow",
"dirs 3.0.1",
"log",
"thiserror",
]
[[package]]
name = "espanso-render"
version = "0.1.0"
@ -482,7 +513,7 @@ checksum = "3dfb6b71a9a89cd38b395d994214297447e8e63b1ba5708a9a2b0b1048ceda76"
dependencies = [
"cc",
"chrono",
"dirs",
"dirs 1.0.5",
"objc-foundation",
]

View File

@ -11,4 +11,5 @@ members = [
"espanso-clipboard",
"espanso-render",
"espanso-info",
"espanso-path",
]

View File

@ -21,5 +21,6 @@ espanso-config = { path = "../espanso-config" }
espanso-match = { path = "../espanso-match" }
espanso-clipboard = { path = "../espanso-clipboard" }
espanso-info = { path = "../espanso-info" }
espanso-path = { path = "../espanso-path" }
maplit = "1.0.2"
simplelog = "0.9.0"

View File

@ -22,6 +22,10 @@ fn main() {
// ),
])
.unwrap();
let paths = espanso_path::resolve_paths();
println!("paths: {:?}", paths);
let config = espanso_config::load_legacy(&paths.config, &paths.packages).unwrap();
// let icon_paths = vec![
// (