diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 32 |
1 files changed, 32 insertions, 0 deletions
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 @@ | |||
1 | use backup::Backup; | ||
2 | use config::Config; | ||
3 | use packages::{pacman::Pacman, PackageManager}; | ||
4 | use storage::save_index; | ||
5 | |||
6 | mod backup; | ||
7 | mod config; | ||
8 | mod error; | ||
9 | mod pathinfo; | ||
10 | mod packages; | ||
11 | mod storage; | ||
12 | |||
13 | fn main() -> anyhow::Result<()> { | ||
14 | let mut cfg = Config::load()?; | ||
15 | cfg.user.push("fx".to_string()); | ||
16 | cfg.directories.push("~/.config/nvim".to_string()); | ||
17 | cfg.directories.push("~/.config/hypr".to_string()); | ||
18 | let toml = toml::to_string(&cfg)?; | ||
19 | println!("{toml}"); | ||
20 | |||
21 | let pacman = Pacman; | ||
22 | let pkgs = pacman.get_installed(); | ||
23 | |||
24 | let backup = Backup::create(&cfg, pkgs)?; | ||
25 | // println!("{backup:#?}"); | ||
26 | |||
27 | save_index(backup); | ||
28 | |||
29 | // let fi = FileInfo::new("~/.config/nvim", &cfg)?; | ||
30 | // println!("{:?}", fi.get_absolute_path()); | ||
31 | Ok(()) | ||
32 | } | ||