diff --git a/.autogen/check_pr.jq b/.autogen/check_pr.jq new file mode 100644 index 0000000000..0adb0b503d --- /dev/null +++ b/.autogen/check_pr.jq @@ -0,0 +1,3 @@ +.[] +.head +.label diff --git a/.autogen/next_url.jq b/.autogen/next_url.jq new file mode 100644 index 0000000000..b4c3b819a5 --- /dev/null +++ b/.autogen/next_url.jq @@ -0,0 +1,2 @@ +.links +.next diff --git a/.autogen/patreon.jq b/.autogen/patreon.jq new file mode 100644 index 0000000000..c761d587b8 --- /dev/null +++ b/.autogen/patreon.jq @@ -0,0 +1,39 @@ +( + .data | + map( + select( + .relationships + .currently_entitled_tiers + .data[] + ) + ) | + map( + .relationships + .user + .data + .id + ) +) as $data | +.included | +map( + select( + .id as $id | + $data | + contains( + [ + $id + ] + ) + ) +) | +map( + .attributes | + [ + .full_name, + .thumb_url, + .url + ] | + @tsv +) | +.[] | +@text diff --git a/.autogen/autogen.sh b/.autogen/update_readme_patreon.sh similarity index 87% rename from .autogen/autogen.sh rename to .autogen/update_readme_patreon.sh index 30198f8048..8f40a78991 100755 --- a/.autogen/autogen.sh +++ b/.autogen/update_readme_patreon.sh @@ -5,7 +5,7 @@ # __MISSKEY_HEAD=acid-chicken:patch-autogen # __MISSKEY_REPO=syuilo/misskey # __MISSKEY_BRANCH=develop -test "$(curl -LSs -w '\n' -- "https://api.github.com/repos/$REPO/pulls?access_token=$__MISSKEY_GITHUB_TOKEN" | jq -r '.[].head.label' | grep $__MISSKEY_HEAD)" && exit 1 +test "$(curl -LSs -w '\n' -- "https://api.github.com/repos/$REPO/pulls?access_token=$__MISSKEY_GITHUB_TOKEN" | jq -r -f check_pr.jq | grep $__MISSKEY_HEAD)" && exit 1 cd "$(dirname $0)/.." && \ touch null.cache && \ rm *.cache && \ @@ -30,7 +30,7 @@ while : touch patreon.cache && \ rm patreon.cache && \ cat patreon.raw.cache | \ - jq -r '(.data|map(select(.relationships.currently_entitled_tiers.data[]))|map(.relationships.user.data.id))as$data|.included|map(select(.id as$id|$data|contains([$id])))|map(.attributes|[.full_name,.thumb_url,.url]|@tsv)|.[]|@text' >> patreon.cache && \ + jq -r -f patreon.jq >> patreon.cache && \ echo '