summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 1fdcebf..e0b3758 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,22 +1,21 @@
1use backup::Backup; 1use backup::Backup;
2use config::Config; 2use config::Config;
3use packages::{pacman::Pacman, PackageManager}; 3use packages::{pacman::Pacman, PackageManager};
4use storage::save_index;
5 4
6mod backup; 5mod backup;
7mod config; 6mod config;
8mod error; 7mod error;
9mod pathinfo; 8mod pathinfo;
10mod packages; 9mod packages;
11mod storage;
12 10
13fn main() -> anyhow::Result<()> { 11fn main() -> color_eyre::Result<()> {
12 color_eyre::install()?;
13
14 let mut cfg = Config::load()?; 14 let mut cfg = Config::load()?;
15 cfg.user.push("fx".to_string()); 15 cfg.user.push("fx".to_string());
16 cfg.directories.push("~/.config/nvim".to_string()); 16 cfg.directories.push("~/.config/nvim".to_string());
17 cfg.directories.push("~/.config/hypr".to_string()); 17 cfg.directories.push("~/.config/hypr".to_string());
18 let toml = toml::to_string(&cfg)?; 18 cfg.root = "./backup".to_string();
19 println!("{toml}");
20 19
21 let pacman = Pacman; 20 let pacman = Pacman;
22 let pkgs = pacman.get_installed(); 21 let pkgs = pacman.get_installed();
@@ -24,7 +23,9 @@ fn main() -> anyhow::Result<()> {
24 let backup = Backup::create(&cfg, pkgs)?; 23 let backup = Backup::create(&cfg, pkgs)?;
25 // println!("{backup:#?}"); 24 // println!("{backup:#?}");
26 25
27 save_index(backup); 26 backup.save(&cfg)?;
27
28 Backup::get(&cfg, None)?;
28 29
29 // let fi = FileInfo::new("~/.config/nvim", &cfg)?; 30 // let fi = FileInfo::new("~/.config/nvim", &cfg)?;
30 // println!("{:?}", fi.get_absolute_path()); 31 // println!("{:?}", fi.get_absolute_path());