From a477e741bf96cac3519794c12d750ffdfe5a6d7b Mon Sep 17 00:00:00 2001 From: aawsome <37850842+aawsome@users.noreply.github.com> Date: Tue, 13 Feb 2024 00:36:17 +0100 Subject: [PATCH] fix(commands): Ask for password in backup and copy command if it is missing (#1061) A user discovered that for some commands they are not being asked for a password, although they should. This implements a fix for the backup and copy command so they consistently call the same functionality that is being used for the other commands. Hence, asking for the password, if it's missing. --- src/commands/backup.rs | 4 ++-- src/commands/copy.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/backup.rs b/src/commands/backup.rs index df53d2d..9449b01 100644 --- a/src/commands/backup.rs +++ b/src/commands/backup.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use crate::{ - commands::{get_repository, init::init}, + commands::{get_repository, init::init, open_repository}, helpers::bytes_size_to_string, status_err, Application, RUSTIC_APP, }; @@ -144,7 +144,7 @@ impl BackupCmd { } init(repo, &self.key_opts, &self.config_opts)? } else { - repo.open()? + open_repository(&config.repository)? } .to_indexed_ids()?; diff --git a/src/commands/copy.rs b/src/commands/copy.rs index 3a9ef4d..c26e746 100644 --- a/src/commands/copy.rs +++ b/src/commands/copy.rs @@ -82,7 +82,7 @@ impl CopyCmd { let pass = repo_dest.password()?.unwrap(); repo_dest.init_with_config(&pass, &self.key_opts, config_dest)? } else { - repo_dest.open()? + open_repository(target_opt)? }; info!("copying to target {}...", repo_dest.name);