diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 9 |
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(()) |