commit 76f5844f4dbf9f07f2e855a69f65c94000469f5e
parent 256526c06b89811a4cb372c7068ceb2178bd4fce
Author: Cem Keylan <cem@ckyln.com>
Date: Fri, 6 Nov 2020 15:03:33 +0300
pm_ask(): remove modified pash using traps
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/bin/muw b/bin/muw
@@ -93,9 +93,10 @@ pm_ask() {
case ${pass_prog##*/} in
pass) pass insert "$pmt"
password_command="pass show $pmt" ;;
- pash) sed 's/yn "Gen/false "Gen/g' "$(command -v pash)" >_
+ pash) trap 'delete; rm -f _' EXIT INT
+ sed 's/yn "Gen/false "Gen/g' "$(command -v pash)" >_
sh _ add "$pmt"
- rm -f _
+ rm -f _; trap delete EXIT INT
password_command="pash show $pmt" ;;
pm) pass=$(prompt_noecho "Enter your password")
pass2=$(prompt_noecho "Enter your password again")