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-themes/update.sh

13 lines
496 B
Bash
Raw Normal View History

2023-04-27 09:28:50 +00:00
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq
cd web/workpress-themes
set -ex
for plugin in $(cat themes); do
META=$(curl https://api.wordpress.org/themes/info/1.1/?action\=theme_information\&request\\\[slug\\\]\=$plugin)
2023-04-27 18:38:16 +00:00
SHA256=$(curl -L $(echo $META | jq -r '.download_link') | sha256sum | awk '{print $1}')
2023-04-27 09:28:50 +00:00
echo $META | jq '{"version": .version, "pname": .slug, "description": .name, "url": .download_link, "sha256": $SHA256}' --arg SHA256 $SHA256 > $plugin.json
done