From 0e4b40f655c255325568fb8b11a436035af48324 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 29 Sep 2022 19:54:43 +0800 Subject: Fix log error about return code --- tools/desktop/password-store.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/desktop/password-store.sh b/tools/desktop/password-store.sh index 21dec79..1de3148 100755 --- a/tools/desktop/password-store.sh +++ b/tools/desktop/password-store.sh @@ -10,8 +10,6 @@ sed 's/.gpg$//' | \ rofi -dmenu "${ROFI_ARGS[@]}" | { # Get arguments for command 'pass' read ARG1 ARG2 - echo ARG1: $ARG1 - echo ARG2: $ARG2 if [[ -z $ARG1 ]]; then exit 1 @@ -35,8 +33,11 @@ rofi -dmenu "${ROFI_ARGS[@]}" | { -e "Copied: $ARG1 $(echo; echo; cat | sed '1{/^$/d}')" } || { # Make sure user want to create a new password - alacritty -e dialog --yesno \ - "Password doesn't exist, Generate a new one?" 7 30 || exit 1 + return_code=$(alacritty -e sh -c ' + dialog --yesno "Password does not exist, Generate a new one?" 8 30; + echo "$?" + ') + [[ $return_code == 1 ]] && exit 1 # Generate a new password by ARG1 alacritty -e pass generate $ARG1 --clip && \ -- cgit v1.2.3-70-g09d2