diff options
author | Luke Smith <luke@lukesmith.xyz> | 2023-08-23 11:06:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-23 11:06:11 +0000 |
commit | 7a1fe918a12f49970c15b4018f5676b673743094 (patch) | |
tree | fafd757cb109ee815fadbd56d0cb33b6f38382ec | |
parent | 07e4bb14e0b15cf4fe94a1478386f78a19cf00a6 (diff) | |
parent | 268da5d51b1e710f244507296f911cd847fb8dbe (diff) |
Merge pull request #953 from rampaq/pipe-to-pass
pipe password directly to pass
-rwxr-xr-x | bin/mw | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -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() { |