From 5a50536e59babfe62a01480070e7b3481707f9b0 Mon Sep 17 00:00:00 2001 From: Grafcube Date: Thu, 11 May 2023 17:02:14 +0530 Subject: [PATCH 1/3] Fix transient argument The transient variable must not be quoted. Otherwise the command fails with `Invalid number of options.` for unsuccessful error codes. --- auto-notify.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index 118af69..180a589 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -56,7 +56,7 @@ function _auto_notify_message() { urgency="critical" transient="" fi - notify-send "$title" "$body" --app-name=zsh "$transient" "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" + notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" elif [[ "$platform" == "Darwin" ]]; then osascript \ -e 'on run argv' \ From 00951ac085a3f27f0922fa269704ca7f976ed203 Mon Sep 17 00:00:00 2001 From: Michael Aquilina Date: Thu, 11 May 2023 15:15:01 +0100 Subject: [PATCH 2/3] build: update docker job image and install libnotify-bin --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 236e963..45f4411 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ test: &test - checkout - run: name: Install Dependencies - command: apt-get update && apt-get install -y curl git ncurses-bin + command: apt-get update && apt-get install -y curl git ncurses-bin libnotify-bin - run: name: Download requirements command: | @@ -25,7 +25,7 @@ test: &test jobs: lint: docker: - - image: "python:3.7-stretch" + - image: "python:3.11" steps: - checkout - run: From 993f5de86ec607e129da8eb2b55d1524865d808f Mon Sep 17 00:00:00 2001 From: Michael Aquilina Date: Thu, 11 May 2023 15:23:14 +0100 Subject: [PATCH 3/3] fix: update tests to include --transient flag --- tests/test_auto_notify_send.zunit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_auto_notify_send.zunit b/tests/test_auto_notify_send.zunit index 5704f6b..b1e00cf 100644 --- a/tests/test_auto_notify_send.zunit +++ b/tests/test_auto_notify_send.zunit @@ -89,7 +89,7 @@ assert "$lines[1]" same_as 'Notification Title: "f bar -r" Completed' assert "$lines[2]" same_as "Notification Body: Total time: 20 seconds" assert "$lines[3]" same_as "Exit code: 0" - assert "$lines[4]" same_as "--app-name=zsh --urgency=normal --expire-time=15000" + assert "$lines[4]" same_as "--app-name=zsh --transient --urgency=normal --expire-time=15000" } @test 'auto-notify-send sends notification on macOS' {