diff options
author | fxqnlr <[email protected]> | 2024-09-06 13:47:47 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-09-06 13:47:47 +0200 |
commit | ab7f99e061e54924899b778e929dd2e17c8792d9 (patch) | |
tree | 644dc766f954b7a5e04cf7658821a5b5694f764b /src/main.rs | |
parent | 3e1cb020d5449849b37874f91cadfa4a9c878747 (diff) | |
download | arbs-ab7f99e061e54924899b778e929dd2e17c8792d9.tar arbs-ab7f99e061e54924899b778e929dd2e17c8792d9.tar.gz arbs-ab7f99e061e54924899b778e929dd2e17c8792d9.zip |
add root index and directory creation
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()); |