From 054db2b11c9822969f80c08fdaa6ed2aef101ea9 Mon Sep 17 00:00:00 2001 From: nomadics9 Date: Fri, 20 Dec 2024 19:47:44 +0300 Subject: [PATCH] fix: script sh compliance --- watchTV.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/watchTV.sh b/watchTV.sh index 882e628..75dd6b8 100755 --- a/watchTV.sh +++ b/watchTV.sh @@ -7,8 +7,12 @@ fi LAST_RELEASE_FILE=/data/alaskartv/androidtv-ci/release.txt latest_release=$(curl -s "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/latest" | jq -r '.tag_name') - -if [ "$latest_release" != "$(cat $LAST_RELEASE_FILE 2>/dev/null)" ]; then +if [ -f "$LAST_RELEASE_FILE" ]; then + read -r version < "$LAST_RELEASE_FILE" +else + version="" +fi +if [ "$latest_release" != "$version" ]; then # echo "$latest_release" > "$LAST_RELEASE_FILE" curl -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \ -d chat_id="$CHAT_ID" \