From 9894e5b781391c61ebe02929ba1d71a55924a99b Mon Sep 17 00:00:00 2001 From: syui Date: Wed, 27 Nov 2024 20:28:31 +0900 Subject: [PATCH] fix --- at.zsh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/at.zsh b/at.zsh index d956681..babccab 100755 --- a/at.zsh +++ b/at.zsh @@ -46,6 +46,21 @@ function at-did-search(){ curl -sL "$url?repo=$handle"|jq . } +function at-collection-search(){ + reverse=false + if [ -n "$1" ];then + at_uri=$1 + fi + if [ "$2" = "-r" ];then + reverse=true + fi + req=xrpc/com.atproto.repo.listRecords + url=https://${host}/${req} + did=`echo $at_uri|cut -d / -f 3` + collection=`echo $at_uri|cut -d / -f 4` + curl -sL "$url?repo=$did&collection=$collection&reverse=$reverse"|jq . +} + at-env case $1 in uri|u) @@ -54,6 +69,9 @@ case $1 in did|d) at-did-search $2 ;; + collection|c) + at-collection-search $2 $3 + ;; *) echo "${help[@]}" echo "${host[@]}"