Ran into an issue where
echo "password" | pass insert foo/bar/baz
was in shell code.. and ran but:
- should have had '-e' expressly on the C/L
- created ~/.password-store/foo/bar .. but no baz.gpg
- returned no visible error because the read's tromped the input lines
Was frustrating to review the code using sh -xv and see what transpired. A
simple fix offered for this:
> git diff master
diff --git a/src/password-store.sh b/src/password-store.sh
index 77f3eda..ed7927a 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -459,6 +459,9 @@ cmd_insert() {
echo
$GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}" || die
"Password encryption aborted."
elif [[ $noecho -eq 1 ]]; then
+ if ! [[ -t 0 ]]; then
+ die "use -e if not interactive"
+ fi
local password password_again
while true; do
read -r -p "Enter password for $path: " -s password || exit 1
Happy days.
-b
branson matheson
[email protected]
_______________________________________________
Password-Store mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/password-store