mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 22:27:03 +05:30
Initial commit
This commit is contained in:
commit
05201d7de7
10 changed files with 640 additions and 0 deletions
20
src/main.rs
Normal file
20
src/main.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
mod config;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use dirs::config_dir;
|
||||
|
||||
use crate::config::Replacements;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let mut config_path = config_dir().ok_or(anyhow!("Failed to get config dir"))?;
|
||||
config_path.push("substitutor");
|
||||
config_path.push("config");
|
||||
config_path.set_extension("toml");
|
||||
let config: Replacements = if config_path.exists() {
|
||||
let config_str = std::fs::read_to_string(config_path.as_path())?;
|
||||
toml::from_str(&config_str)?
|
||||
} else {
|
||||
Replacements::default()
|
||||
};
|
||||
Ok(())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue