1 #!/usr/bin/env nix-shell
2 #!nix-shell -I nixpkgs=../../../../../ -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github jq
4 if [ "$#" -gt 1 ] ||
[[ "$1" == -* ]]; then
5 echo "Regenerates packaging data for the element packages."
6 echo "Usage: $0 [git release tag]"
14 if [ -z "$version" ]; then
15 version
="$(wget -q -O- "https
://api.github.com
/repos
/element-hq
/element-desktop
/releases?per_page
=1" | jq -r '.[0].tag_name')"
19 version
="${version#v}"
22 web_src
="https://raw.githubusercontent.com/element-hq/element-web/v$version"
23 web_src_hash
=$
(nix-prefetch-github element-hq element-web
--rev v
${version} | jq
-r .
hash)
25 web_tmpdir
=$
(mktemp
-d)
26 trap 'rm -rf "$web_tmpdir"' EXIT
29 wget
-q "$web_src/yarn.lock"
30 web_yarn_hash
=$
(prefetch-yarn-deps yarn.lock
)
34 desktop_src
="https://raw.githubusercontent.com/element-hq/element-desktop/v$version"
35 desktop_src_hash
=$
(nix-prefetch-github element-hq element-desktop
--rev v
${version} | jq
-r .
hash)
37 desktop_tmpdir
=$
(mktemp
-d)
38 trap 'rm -rf "$desktop_tmpdir"' EXIT
41 wget
-q "$desktop_src/yarn.lock"
42 desktop_yarn_hash
=$
(prefetch-yarn-deps yarn.lock
)
47 "version" = "$version";
49 "desktopSrcHash" = "$desktop_src_hash";
50 "desktopYarnHash" = "$desktop_yarn_hash";
51 "webSrcHash" = "$web_src_hash";
52 "webYarnHash" = "$web_yarn_hash";