aboutsummaryrefslogtreecommitdiffstats
path: root/src/dirs.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-04-06 06:35:30 -0400
committerJesse Luehrs <doy@tozt.net>2020-04-06 06:35:30 -0400
commitbc18bca5c67b4a678a31198877e39d57d97b1e0c (patch)
tree3dc31608586cbe0f7973d7aa730267d57224e6a1 /src/dirs.rs
parent4ad2f0a0dc3abb4cb10a6b82ca6a1f3a829eb1fb (diff)
downloadrbw-bc18bca5c67b4a678a31198877e39d57d97b1e0c.tar.gz
rbw-bc18bca5c67b4a678a31198877e39d57d97b1e0c.zip
factor out into an agent
Diffstat (limited to 'src/dirs.rs')
-rw-r--r--src/dirs.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/dirs.rs b/src/dirs.rs
new file mode 100644
index 0000000..177ea58
--- /dev/null
+++ b/src/dirs.rs
@@ -0,0 +1,14 @@
+pub fn config_dir() -> std::path::PathBuf {
+ let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap();
+ project_dirs.config_dir().to_path_buf()
+}
+
+pub fn cache_dir() -> std::path::PathBuf {
+ let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap();
+ project_dirs.cache_dir().to_path_buf()
+}
+
+pub fn runtime_dir() -> std::path::PathBuf {
+ let project_dirs = directories::ProjectDirs::from("", "", "rbw").unwrap();
+ project_dirs.runtime_dir().unwrap().to_path_buf()
+}