diff --git a/src/commands/git_secret_hide.sh b/src/commands/git_secret_hide.sh index 8f55d332..fb4f3cc6 100644 --- a/src/commands/git_secret_hide.sh +++ b/src/commands/git_secret_hide.sh @@ -146,6 +146,9 @@ function hide { local recipients recipients=$(_get_recipients) + local secrets_dir_keys + secrets_dir_keys=$(_get_secrets_dir_keys) + local input_path local output_path input_path=$(_append_root_path "$filename") @@ -156,10 +159,8 @@ function hide { # encrypt file only if required if [[ "$fsdb_file_hash" != "$file_hash" ]]; then # shellcheck disable=2086 - local secrets_dir_keys - secrets_dir_keys=$(_get_secrets_dir_keys) $SECRETS_GPG_COMMAND --homedir "$secrets_dir_keys" "--no-permission-warning" --use-agent --yes --trust-model=always --encrypt \ - $recipients -o "$output_path" "$input_path" > /dev/null 2>&1 + "$recipients" -o "$output_path" "$input_path" > /dev/null 2>&1 local exit_code=$? if [[ "$exit_code" -ne 0 ]]; then _abort "problem encrypting file with gpg: exit code $exit_code: $filename" diff --git a/src/commands/git_secret_killperson.sh b/src/commands/git_secret_killperson.sh index 7381b598..ffd5cc3b 100644 --- a/src/commands/git_secret_killperson.sh +++ b/src/commands/git_secret_killperson.sh @@ -25,9 +25,10 @@ function killperson { _abort "at least one email is required for killperson." fi + # Getting the local git-secret `gpg` key directory: + local secrets_dir_keys + secrets_dir_keys=$(_get_secrets_dir_keys) for email in "${emails[@]}"; do - local secrets_dir_keys - secrets_dir_keys=$(_get_secrets_dir_keys) $SECRETS_GPG_COMMAND --homedir "$secrets_dir_keys" --no-permission-warning --batch --yes --delete-key "$email" local exit_code=$? if [[ "$exit_code" -ne 0 ]]; then