diff options
Diffstat (limited to 'src/config/env.rs')
| -rw-r--r-- | src/config/env.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/config/env.rs b/src/config/env.rs new file mode 100644 index 0000000..5d53cc5 --- /dev/null +++ b/src/config/env.rs @@ -0,0 +1,22 @@ +use once_cell::sync::Lazy; + +pub static USER_CONFIG_DIR: Lazy<String> = Lazy::new(|| { + match dirs::config_local_dir() { + Some(mut d) => { + d.push("neosheet"); + d.as_path().to_str().unwrap_or("").to_string() + } + None => String::new(), + } +}); + +pub static USER_RC_PATH: Lazy<String> = Lazy::new(|| { + match dirs::config_local_dir() { + Some(mut d) => { + d.push("neosheet"); + d.push("init.lua"); + d.as_path().to_str().unwrap_or("").to_string() + } + None => String::new(), + } +}); |