aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2022-09-29 19:54:43 +0800
committerHsieh Chin Fan <pham@topo.tw>2022-09-29 19:54:43 +0800
commit0e4b40f655c255325568fb8b11a436035af48324 (patch)
tree674a5259ac65df5fa3d20725448da8bb901d0902
parent5853fe6dcb8b6eafe7b85d7ff7d6d7a9b230ad17 (diff)
Fix log error about return code
-rwxr-xr-xtools/desktop/password-store.sh9
1 files 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$//' | \
10rofi -dmenu "${ROFI_ARGS[@]}" | { 10rofi -dmenu "${ROFI_ARGS[@]}" | {
11 # Get arguments for command 'pass' 11 # Get arguments for command 'pass'
12 read ARG1 ARG2 12 read ARG1 ARG2
13 echo ARG1: $ARG1
14 echo ARG2: $ARG2
15 13
16 if [[ -z $ARG1 ]]; then 14 if [[ -z $ARG1 ]]; then
17 exit 1 15 exit 1
@@ -35,8 +33,11 @@ rofi -dmenu "${ROFI_ARGS[@]}" | {
35 -e "Copied: $ARG1 $(echo; echo; cat | sed '1{/^$/d}')" 33 -e "Copied: $ARG1 $(echo; echo; cat | sed '1{/^$/d}')"
36 } || { 34 } || {
37 # Make sure user want to create a new password 35 # Make sure user want to create a new password
38 alacritty -e dialog --yesno \ 36 return_code=$(alacritty -e sh -c '
39 "Password doesn't exist, Generate a new one?" 7 30 || exit 1 37 dialog --yesno "Password does not exist, Generate a new one?" 8 30;
38 echo "$?"
39 ')
40 [[ $return_code == 1 ]] && exit 1
40 41
41 # Generate a new password by ARG1 42 # Generate a new password by ARG1
42 alacritty -e pass generate $ARG1 --clip && \ 43 alacritty -e pass generate $ARG1 --clip && \