mutt-wizard

fork of Luke Smiths mutt-wizard
git clone git://git.jakekoroman.com/mutt-wizard
Log | Files | Refs | README | LICENSE

commit 7a1fe918a12f49970c15b4018f5676b673743094
parent 07e4bb14e0b15cf4fe94a1478386f78a19cf00a6
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Wed, 23 Aug 2023 11:06:11 +0000

Merge pull request #953 from rampaq/pipe-to-pass

pipe password directly to pass
Diffstat:
Mbin/mw | 12+++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/bin/mw b/bin/mw @@ -174,20 +174,14 @@ askinfo() { hostname="${fulladdr#*@}" login="${login:-$fulladdr}" if [ -n "${password+x}" ]; then - createpass + insertpass else getpass fi } -createpass() { - echo "$password" >"$PASSWORD_STORE_DIR/$passprefix$fulladdr" - "$GPG" -qe $(printf -- " -r %s" $(cat "$PASSWORD_STORE_DIR/.gpg-id")) "$PASSWORD_STORE_DIR/$passprefix$fulladdr" - case "$(uname)" in - Darwin | *BSD) rm -P "$PASSWORD_STORE_DIR/$passprefix$fulladdr" ;; - *) shred -u "$PASSWORD_STORE_DIR/$passprefix$fulladdr" ;; - esac - rm -f "$PASSWORD_STORE_DIR/$passprefix$fulladdr" +insertpass() { + printf "%s" "$password" | pass insert -fe "$PASSWORD_STORE_DIR/$passprefix$fulladdr" } errorexit() {