From 1b7b9b4264446e4ff4a4348f833731876dda30a1 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Thu, 18 Nov 2021 11:49:54 +0100 Subject: [PATCH] Add some debug_messages --- rofi-task.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/rofi-task.sh b/rofi-task.sh index 3569570..b2928ff 100755 --- a/rofi-task.sh +++ b/rofi-task.sh @@ -93,10 +93,26 @@ display_current_task() { # {{{ rm --force -- "${TASKW_CURRENT_LIST}" ## If no task was selected (empty var) then exit - [ -z "${TITLE}" ] && echo "Cancelled." && exit 0 + if [ -z "${TITLE}" ]; then + echo "Cancelled." + debug_message "display_current_task − \ +TITLE var is ${RED}empty${COLOR_DEBUG}." + exit 0 + else + debug_message "display_current_task − \ +TITLE var: ${RED}${TITLE}${RESET}." + fi ## If no ID was found (empty var) then exit - [ -z "${ID}" ] && echo "Cancelled." && exit 0 + if [ -z "${ID}" ]; then + echo "Cancelled." + debug_message "display_current_task − \ +ID var is ${RED}empty${COLOR_DEBUG}." + exit 0 + else + debug_message "display_current_task − \ +ID var: ${RED}${ID}${RESET}." + fi ## Kill any pomodorrior process running for the current task pkill --full -- "${TITLE}"