jq adding
This commit is contained in:
parent
abf7cb9cd9
commit
d728bc7264
|
@ -7,12 +7,13 @@ IPNS="$1"
|
||||||
echo "{data:[]}" > ~/.zen/tmp/chan_cloud.json
|
echo "{data:[]}" > ~/.zen/tmp/chan_cloud.json
|
||||||
|
|
||||||
for channel in $(ls ~/.zen/bunkerbox/channels); do
|
for channel in $(ls ~/.zen/bunkerbox/channels); do
|
||||||
echo "Adding $channel"
|
|
||||||
howmuch=$(jq '.Videos | length' ~/.zen/bunkerbox/history.${channel}.json)
|
howmuch=$(jq '.Videos | length' ~/.zen/bunkerbox/history.${channel}.json)
|
||||||
[[ ! $howmuch ]] && continue
|
[[ ! $howmuch ]] && continue
|
||||||
|
echo "Adding $channel"
|
||||||
|
|
||||||
echo "$howmuch posting"
|
echo "$howmuch posting"
|
||||||
|
|
||||||
cat ~/.zen/tmp/chan_cloud.json | jq --arg CHANNEL "$channel" --arg HOWMUCH "$howmuch" --arg IPNS "$IPNS" '.data += [{"name": "'''$CHANNEL'''", "link": "/ipns/'''$IPNS'''/tw/'''$CHANNEL'''", "weight": "'''$HOWMUCH'''" ,"tooltip": "'''$CHANNEL'''"}]' > ~/.zen/tmp/chan_cloud_plus.json
|
cat ~/.zen/tmp/chan_cloud.json | jq '.data += [{"name": "'''$channel'''", "link": "/ipns/'''$IPNS'''/tw/'''$channel'''", "weight": "'''$howmuch'''" ,"tooltip": "'''$channel'''"}]' > ~/.zen/tmp/chan_cloud_plus.json
|
||||||
|
|
||||||
cp ~/.zen/tmp/chan_cloud_plus.json ~/.zen/tmp/chan_cloud.json
|
cp ~/.zen/tmp/chan_cloud_plus.json ~/.zen/tmp/chan_cloud.json
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue