From dd3d3357cdeb05d83210b0f51d9fe4bffbc3f387 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Mon, 7 Aug 2023 13:59:00 +0200 Subject: test: first attempt to test. General mechanism works, but the first tested function breaks. --- pinentry-rofi.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pinentry-rofi.sh') diff --git a/pinentry-rofi.sh b/pinentry-rofi.sh index 1bfae50..5a32d65 100755 --- a/pinentry-rofi.sh +++ b/pinentry-rofi.sh @@ -45,14 +45,19 @@ assuan_send() { split_line() { rmfirst=${2:-0} + log_debug "args: \"$1\", ${rmfirst}" read -ra out_arr <<< "$1" - if [ "$rmfirst" -ne 1 ] ; then + log_debug "out: $(declare -p out_arr)" + if [ $rmfirst -ne 1 ] ; then unset "out_arr[0]" fi echo "${out_arr[@]}" } rofi_cmd="rofi -dmenu -input /dev/null -password" +INSIDE_BATS=${INSIDE_BATS:-0} + +if [ $INSIDE_BATS -ne 1 ] ; then assuan_send "OK Please go ahead" @@ -62,6 +67,8 @@ win_mesg="" keyinfo="" + + while : ; do read -r line log_debug "line=$line" @@ -178,3 +185,5 @@ while : ; do exit 1 fi done + +fi # End of $INSIDE_BATS exclusion -- cgit