From 879bf6ef11c4d866e8bf541ab514dbc94842c916 Mon Sep 17 00:00:00 2001 From: joseelinchevalay Date: Fri, 27 Mar 2020 16:59:29 +0100 Subject: [PATCH] solved issue with tip.sh and add bc package --- tip/Dockerfile | 2 +- tip/tip.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tip/Dockerfile b/tip/Dockerfile index 6e5f9d5..e2226bc 100644 --- a/tip/Dockerfile +++ b/tip/Dockerfile @@ -10,7 +10,7 @@ ENV NODE_VERSION v12.16.1 COPY ./tip/sbotc.sh /usr/bin/sbotc RUN apt-get update -y && \ - apt-get install autoconf=2.69-11.1 build-essential=12.8 python3-pip=20.0.2-2 python3-setuptools=44.0.0-1 libsodium-dev=1.0.18-1 jq=1.6-1 make=4.2.1-1.2 git=1:2.25.1-1 gcc=4:9.2.1-3.1 base58=1.0.3-1 libtool=2.4.6-14 curl=7.68.0-1 git=1:2.25.1-1 -y && \ + apt-get install autoconf=2.69-11.1 build-essential=12.8 python3-pip=20.0.2-2 python3-setuptools=44.0.0-1 libsodium-dev=1.0.18-1 jq=1.6-1 make=4.2.1-1.2 git=1:2.25.1-1 gcc=4:9.2.1-3.1 base58=1.0.3-1 libtool=2.4.6-14 curl=7.68.0-1 git=1:2.25.1-1 bc=1.07.1-2+b2 -y && \ pip3 install duniterpy==0.56.0 silkaj==0.7.6 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ diff --git a/tip/tip.sh b/tip/tip.sh index 49cf298..13bcb81 100755 --- a/tip/tip.sh +++ b/tip/tip.sh @@ -174,7 +174,7 @@ process_msg() { msg=$1 target_id=$(printf %s "$msg" | jq -r '.value?.content?.vote?.link') || return 1 - target_msg=$(sbotc -e get "$target_id") || return 1 + target_msg=$(sbotc query.read '[{"$filter":{"value":{"content":{}},"key":"'"$target_id"'"}}]') || return 1 target_author=$(printf %s "$target_msg" | jq -r .author) || return 1 msg_content=$(printf %s "$target_msg" | jq -r .content?.text) || return 1 @@ -257,7 +257,7 @@ do ((i++)) fi -done < <(printf '%s' "$messages") +done < <(echo "$messages" | jq -c) if [[ $totalLikesGiven -eq 0 ]] then