Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
2.2 kB · 79 lines
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980#!/usr/bin/env nix-shell#!nix-shell --packages curl#!nix-shell --packages jq#!nix-shell --packages parallel#!nix-shell -i bash
# Exit immediately if a command exits with a non-zero status.# Exit when a producer fails in a pipe# Treat undefined variable references as errorsset -e -o pipefail -u
# Check if working directory is (probably) righttest "./update" = $0 || { echo "The working directory ought to be the same is the update script location. Please invoke as ./update" 1>&2 exit 1}
# Create temporary directory with automatic cleanupreadonly MY_TMP="$(mktemp -d)"cleanup () { rm -rf "$MY_TMP"}trap cleanup EXIT
# stdout: file containing release info and a convenient placeholder# for the sha256 attributegetRelease () { local owner="$1" local repo="$2" local out="$MY_TMP/$owner--$repo-release" curl -fSs https://api.github.com/repos/"$owner"/"$repo"/releases/latest \ | jq '{ version: .name, url: .tarball_url, sha256: "__SHA256__" }' \ > "$out" echo "$out"}
# 'getters' for the release info file
# stdout: unquoted tarball urlreleaseUrl () { local file="$1" jq -r '.url' <"$file"}
# stdout: unquoted versionreleaseVersion () { local file="$1" jq -r '.version' <"$file"}
# Fetch release tarball and compute hash# stdout: base32 sha256 to be used in fetchurlgetReleaseHash () { local file="$1" local name="$2" nix-prefetch-url "$(releaseUrl "$file")" --name "$name-$(releaseVersion "$file").tar.gz"}
# Write a release info file to release-info/$owner-$repo.jsonupdateRelease () { local owner="$1" local repo="$2" local r="$(getRelease "$owner" "$repo")" local hash="$(getReleaseHash "$r" "$repo")" sed \ -e s/__SHA256__/"$hash"/\ <"$r" \ >"release-info/$owner-$repo.json"}
updateRelease LanguageMachines frogdataupdateRelease LanguageMachines frogupdateRelease LanguageMachines libfoliaupdateRelease LanguageMachines mbtupdateRelease LanguageMachines ticcutilsupdateRelease LanguageMachines timblupdateRelease LanguageMachines timblserverupdateRelease LanguageMachines uctoupdateRelease LanguageMachines uctodata