mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 06:33:42 +00:00
30 lines
568 B
Bash
Executable File
30 lines
568 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
function prefetch-sri() {
|
|
nix-prefetch-url "$1" 2>/dev/null | xargs nix hash to-sri --type sha256
|
|
}
|
|
|
|
declare -a PLATFORMS=(
|
|
x86_64-unknown-linux-musl
|
|
x86_64-apple-darwin
|
|
aarch64-apple-darwin
|
|
)
|
|
|
|
LATEST="$(curl -sS https://update.tabnine.com/bundles/version)"
|
|
|
|
cat <<-EOF
|
|
version = "${LATEST}";
|
|
EOF
|
|
|
|
for platform in "${PLATFORMS[@]}"; do
|
|
url="https://update.tabnine.com/bundles/${LATEST}/${platform}/TabNine.zip"
|
|
sha="$(prefetch-sri "$url")"
|
|
cat <<-EOF
|
|
name = "${platform}";
|
|
hash = "${sha}";
|
|
|
|
EOF
|
|
done
|