From 3e1cb020d5449849b37874f91cadfa4a9c878747 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Fri, 6 Sep 2024 10:56:30 +0200 Subject: initial commit, can save index, no modification check --- src/main.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main.rs (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..1fdcebf --- /dev/null +++ b/src/main.rs @@ -0,0 +1,32 @@ +use backup::Backup; +use config::Config; +use packages::{pacman::Pacman, PackageManager}; +use storage::save_index; + +mod backup; +mod config; +mod error; +mod pathinfo; +mod packages; +mod storage; + +fn main() -> anyhow::Result<()> { + let mut cfg = Config::load()?; + cfg.user.push("fx".to_string()); + cfg.directories.push("~/.config/nvim".to_string()); + cfg.directories.push("~/.config/hypr".to_string()); + let toml = toml::to_string(&cfg)?; + println!("{toml}"); + + let pacman = Pacman; + let pkgs = pacman.get_installed(); + + let backup = Backup::create(&cfg, pkgs)?; + // println!("{backup:#?}"); + + save_index(backup); + + // let fi = FileInfo::new("~/.config/nvim", &cfg)?; + // println!("{:?}", fi.get_absolute_path()); + Ok(()) +} -- cgit v1.2.3