1
0
mirror of https://github.com/octoleo/Purse.git synced 2024-12-28 20:12:38 +00:00

encrypt function is already using stdin. add todo.

This commit is contained in:
drduh 2015-07-03 14:16:53 -04:00
parent ec371cbeb7
commit 51faf2ef6b

6
pwd.sh
View File

@ -5,6 +5,7 @@
set -o errtrace
set -o nounset
set -o pipefail
set -x
gpg=$(which gpg)
safe=${PWDSH_SAFE:=pwd.sh.safe}
@ -57,9 +58,10 @@ decrypt () {
encrypt () {
# Encrypt with a password.
echo "${1}" | ${gpg} \
# TODO(drduh): don't retrieve passphrase as arg
${gpg} \
--symmetric --armor --batch --yes \
--passphrase-fd 0 \
--command-fd 0 --passphrase "${1}" \
--output "${2}" "${3}" 2>/dev/null
}