From 815dcd3b809db264fa9b89e16f102d840e117302 Mon Sep 17 00:00:00 2001 From: syui Date: Mon, 24 Feb 2025 12:41:58 +0900 Subject: [PATCH] fix script --- scpt/at.zsh | 2 +- scpt/src/func.zsh | 25 ++++++++++++++----------- scpt/src/tag.zsh | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/scpt/at.zsh b/scpt/at.zsh index ec43e88..c947eb8 100755 --- a/scpt/at.zsh +++ b/scpt/at.zsh @@ -8,7 +8,7 @@ source $d/src/func.zsh at-env case $1 in version|v) - at-version + at-pds-version ;; uri|u) at-uri $2 diff --git a/scpt/src/func.zsh b/scpt/src/func.zsh index ca54a1d..8c2dd58 100644 --- a/scpt/src/func.zsh +++ b/scpt/src/func.zsh @@ -27,25 +27,28 @@ function at-unset() { unset t password token refresh } -function at-version-json() { - latest=`curl -sL https://raw.githubusercontent.com/bluesky-social/atproto/refs/heads/main/packages/pds/package.json |jq -r .version` - echo "[" - echo "{\"latest\":\"$latest\"}," - e=${pds_list[@]: -1} - echo "[" - for i in $pds_list; do +function at-pds-version-env() { + title="atproto pds version" + latest=https://raw.githubusercontent.com/bluesky-social/atproto/refs/heads/main/packages/pds/package.json + pds=(bsky.social syu.is boobee.blue socl.is ) +} +function at-pds-version-json() { + latest=`curl -sL $latest |jq -r .version` + echo "[{\"title\":\"$title\",\"latest\":\"$latest\"},[" + e=${pds[@]: -1} + for i in $pds; do t=`curl -sL ${i}/xrpc/_health |jq -r .version` echo "{\"$i\":\"$t\"}" if [ "$e" != "$i" ];then echo , fi done - echo "]" - echo "]" + echo "]]" } -function at-version() { - at-version-json |jq . +function at-pds-version() { + at-pds-version-env + at-pds-version-json |jq . } function at-uri() { diff --git a/scpt/src/tag.zsh b/scpt/src/tag.zsh index d0ae367..07c970e 100644 --- a/scpt/src/tag.zsh +++ b/scpt/src/tag.zsh @@ -37,4 +37,4 @@ github=( https://github.com/did-method-plc/did-method-plc ) tag=( at bsky bsync pds bgs plc ozone feed jetstream social-app oauth ) -pds_list=(bsky.social syu.is boobee.blue socl.is ) +#pds_list=(bsky.social syu.is boobee.blue socl.is )