summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2024-09-06 10:56:30 +0200
committerfxqnlr <[email protected]>2024-09-06 10:56:30 +0200
commit3e1cb020d5449849b37874f91cadfa4a9c878747 (patch)
treec5503a137c77ac33c1e7ddfd4087cc994b51a43b /src/main.rs
downloadarbs-3e1cb020d5449849b37874f91cadfa4a9c878747.tar
arbs-3e1cb020d5449849b37874f91cadfa4a9c878747.tar.gz
arbs-3e1cb020d5449849b37874f91cadfa4a9c878747.zip
initial commit, can save index, no modification check
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs32
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 @@
1use backup::Backup;
2use config::Config;
3use packages::{pacman::Pacman, PackageManager};
4use storage::save_index;
5
6mod backup;
7mod config;
8mod error;
9mod pathinfo;
10mod packages;
11mod storage;
12
13fn 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}