From 85699cc8f11350626fd44dcd68bd4660310462ec Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Mon, 23 Jan 2017 09:39:33 +0100 Subject: [PATCH] termux-api: Fix termux-notification --content "" --- packages/termux-api/build.sh | 2 +- packages/termux-api/termux-notification | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/termux-api/build.sh b/packages/termux-api/build.sh index 9d3b9d4d..9b688d0e 100644 --- a/packages/termux-api/build.sh +++ b/packages/termux-api/build.sh @@ -1,6 +1,6 @@ TERMUX_PKG_HOMEPAGE=https://termux.com/add-on-api.html TERMUX_PKG_DESCRIPTION="Termux API commands" -TERMUX_PKG_VERSION=0.21 +TERMUX_PKG_VERSION=0.22 termux_step_make_install () { mkdir -p $TERMUX_PREFIX/bin diff --git a/packages/termux-api/termux-notification b/packages/termux-api/termux-notification index 9597ea50..dc77f29c 100755 --- a/packages/termux-api/termux-notification +++ b/packages/termux-api/termux-notification @@ -25,7 +25,6 @@ show_usage () { } OPT_ACTION="" -OPT_CONTENT="" OPT_ID="" OPT_LED_COLOR="" OPT_LED_OFF="" @@ -97,8 +96,9 @@ if [ -n "$OPT_SOUND" ]; then set -- "$@" --ez sound "$OPT_SOUND"; fi if [ -n "$OPT_TITLE" ]; then set -- "$@" --es title "$OPT_TITLE"; fi if [ -n "$OPT_VIBRATE" ]; then set -- "$@" --ela vibrate "$OPT_VIBRATE"; fi -if [ -n "$OPT_CONTENT" ]; then - echo $OPT_CONTENT | /data/data/com.termux/files/usr/libexec/termux-api Notification "$@" +if [ -v OPT_CONTENT ]; then + # Note that we want to accept an empty content (--content ""). + echo ${OPT_CONTENT:=""} | /data/data/com.termux/files/usr/libexec/termux-api Notification "$@" else /data/data/com.termux/files/usr/libexec/termux-api Notification "$@" fi -- 2.11.0