diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 13 |
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 @@ | |||
1 | use backup::Backup; | 1 | use backup::Backup; |
2 | use config::Config; | 2 | use config::Config; |
3 | use packages::{pacman::Pacman, PackageManager}; | 3 | use packages::{pacman::Pacman, PackageManager}; |
4 | use storage::save_index; | ||
5 | 4 | ||
6 | mod backup; | 5 | mod backup; |
7 | mod config; | 6 | mod config; |
8 | mod error; | 7 | mod error; |
9 | mod pathinfo; | 8 | mod pathinfo; |
10 | mod packages; | 9 | mod packages; |
11 | mod storage; | ||
12 | 10 | ||
13 | fn main() -> anyhow::Result<()> { | 11 | fn 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()); |