depot/third_party/nixpkgs/pkgs/development/libraries/libhsts/update.sh
Default email d419639f9c Project import generated by Copybara.
GitOrigin-RevId: 6b1057b452c55bb3b463f0d7055bc4ec3fd1f381
2021-02-17 18:02:09 +01:00

13 lines
560 B
Bash
Executable file

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq
set -euo pipefail -x
cd "$(dirname "$0")"
chromium_version=$(curl -s "https://api.github.com/repos/chromium/chromium/tags" | jq -r 'map(select(.prerelease | not)) | .[1].name')
sha256=$(nix-prefetch-url "https://raw.github.com/chromium/chromium/$chromium_version/net/http/transport_security_state_static.json")
sed -e "0,/chromium_version/s/chromium_version = \".*\"/chromium_version = \"$chromium_version\"/" \
-e "0,/sha256/s/sha256 = \".*\"/sha256 = \"$sha256\"/" \
--in-place ./default.nix