1 #!/usr/bin/env nix-shell
2 #!nix-shell -I nixpkgs=../../../../ -i bash -p nix curl jq prefetch-yarn-deps nix-prefetch-github nix-prefetch-git
4 if [ "$#" -gt 1 ] ||
[[ "$1" == -* ]]; then
5 echo "Regenerates packaging data for matrix-appservice-slack."
6 echo "Usage: $0 [git release tag]"
14 if [ -z "$version" ]; then
15 version
="$(curl "https
://api.github.com
/repos
/matrix-org
/matrix-appservice-slack
/releases?per_page
=1" | jq -r '.[0].tag_name')"
18 src
="https://raw.githubusercontent.com/matrix-org/matrix-appservice-slack/$version"
19 src_hash
=$
(nix-prefetch-github matrix-org matrix-appservice-slack
--rev ${version} | jq
-r .
hash)
22 trap 'rm -rf "$tmpdir"' EXIT
25 curl
-O "$src/yarn.lock"
26 yarn_hash
=$
(prefetch-yarn-deps yarn.lock
)
29 curl
-O "$src/package.json"
32 "version": "$version",
33 "srcHash": "$src_hash",
34 "yarnHash": "$yarn_hash"