bandwhich: 0.23.0 -> 0.23.1; move to by-name; nixfmt; useFetchCargoVendor (#356934)
[NixPkgs.git] / pkgs / development / tools / replay-io / update.sh
blob49f68d6677ed5846016c761189e8b07155ea004a
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl jq gnused
4 set -euo pipefail
6 # e.g. linux-gecko-20220331-59d0a686993f-ffd8d6280276
7 BUILD_ID=$(curl https://static.replay.io/downloads/linux-replay.json | jq .buildId -r)
8 REVISION=$(echo $BUILD_ID | sed 's/^.*-//')
9 NODE_BUILD_ID=$(curl https://static.replay.io/downloads/linux-replay-node.json | jq .buildId -r)
11 REPLAY_DL=https://static.replay.io/downloads/${BUILD_ID}.tar.bz2
12 LIB_DL=https://static.replay.io/downloads/linux-recordreplay-${REVISION}.tgz
13 NODE_DL=https://static.replay.io/downloads/${NODE_BUILD_ID}
16 cat >"${BASH_SOURCE%/*}/meta.json" <<EOF
18 "replay": {
19 "url": "${REPLAY_DL}",
20 "sha256": "$(nix-prefetch-url --type sha256 "${REPLAY_DL}")"
22 "recordreplay": {
23 "url": "${LIB_DL}",
24 "sha256": "$(nix-prefetch-url --type sha256 --unpack "${LIB_DL}")",
25 "stripRoot": false
27 "replay-node": {
28 "url": "${NODE_DL}",
29 "sha256": "$(nix-prefetch-url --type sha256 "${NODE_DL}")"
32 EOF