summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2024-09-14 18:59:23 +0200
committerfxqnlr <[email protected]>2024-09-14 18:59:23 +0200
commit0ed94b3f011a2d3c22bdc4affb502720be22c371 (patch)
tree9fb2cdbdccfa8c9cf5d9b8d3ccc48443fe6706a6 /src/main.rs
parent1b99a4a1ed7772c9b68e59f46e493ea5b4715239 (diff)
downloadarbs-0ed94b3f011a2d3c22bdc4affb502720be22c371.tar
arbs-0ed94b3f011a2d3c22bdc4affb502720be22c371.tar.gz
arbs-0ed94b3f011a2d3c22bdc4affb502720be22c371.zip
add restoration of files and packages
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 7393af9..487d095 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -46,13 +46,16 @@ fn main() -> color_eyre::Result<()> {
46 let backup = Backup::create(&config, package_manager)?; 46 let backup = Backup::create(&config, package_manager)?;
47 backup.save(&config)?; 47 backup.save(&config)?;
48 } 48 }
49 Subcommands::Restore => { 49 Subcommands::Restore { package_install } => {
50 let Some(last_backup) = Backup::get_last(&config)? else { 50 let Some(last_backup) = Backup::get_last(&config)? else {
51 return Err(Error::BackupNotFound)?; 51 return Err(Error::BackupNotFound)?;
52 }; 52 };
53 53
54 last_backup.packages.install()?; 54 if package_install {
55 last_backup.restore(); 55 last_backup.packages.install()?;
56 }
57
58 last_backup.restore(&config)?;
56 } 59 }
57 }; 60 };
58 Ok(()) 61 Ok(())