This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
nix-packages/web/wordpress-plugins/update.sh

13 lines
462 B
Bash
Raw Normal View History

2023-04-25 06:31:46 +00:00
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq
2023-04-30 18:55:50 +00:00
cd web/wordpress-plugins
2023-04-25 06:31:46 +00:00
set -ex
for plugin in $(cat plugins); do
META=$(curl https://api.wordpress.org/plugins/info/1.0/$plugin.json)
SHA256=$(curl $(echo $META | jq -r '.versions[.version]') | sha256sum | awk '{print $1}')
echo $META | jq '{"version": .version, "pname": .slug, "description": .name, "url": .versions[.version], "sha256": $SHA256}' --arg SHA256 $SHA256 > $plugin.json
done