Support `RAD_PASSPHRASE` in `signer` method

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
Alexis Sellier 2022-11-18 10:57:25 +01:00
parent 1d798a80b4
commit d6a95e4d58
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

View File

@ -177,7 +177,9 @@ pub fn abort<D: fmt::Display>(prompt: D) -> bool {
/// Get the signer. First we try getting it from ssh-agent, otherwise we prompt the user.
pub fn signer(profile: &Profile) -> anyhow::Result<Box<dyn Signer>> {
let signer = if let Ok(signer) = profile.signer() {
let signer = if let Ok(passphrase) = read_passphrase_from_env_var() {
MemorySigner::load(&profile.keystore, passphrase)?.boxed()
} else if let Ok(signer) = profile.signer() {
signer.boxed()
} else {
let passphrase = secret_input();