From 0ed94b3f011a2d3c22bdc4affb502720be22c371 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sat, 14 Sep 2024 18:59:23 +0200 Subject: add restoration of files and packages --- src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main.rs') 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<()> { let backup = Backup::create(&config, package_manager)?; backup.save(&config)?; } - Subcommands::Restore => { + Subcommands::Restore { package_install } => { let Some(last_backup) = Backup::get_last(&config)? else { return Err(Error::BackupNotFound)?; }; - last_backup.packages.install()?; - last_backup.restore(); + if package_install { + last_backup.packages.install()?; + } + + last_backup.restore(&config)?; } }; Ok(()) -- cgit v1.2.3