diff options
author | fxqnlr <[email protected]> | 2024-09-14 18:59:23 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-09-14 18:59:23 +0200 |
commit | 0ed94b3f011a2d3c22bdc4affb502720be22c371 (patch) | |
tree | 9fb2cdbdccfa8c9cf5d9b8d3ccc48443fe6706a6 /src/main.rs | |
parent | 1b99a4a1ed7772c9b68e59f46e493ea5b4715239 (diff) | |
download | arbs-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.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(()) |