this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 23 lines 724 B view raw
1#! /usr/bin/env nix-shell 2#! nix-shell -i bash 3#! nix-shell -p curl jq nix 4 5set -eufo pipefail 6 7FILE=$1 8PROJECT=$2 9BRANCH=${3:-master} 10 11OWNER=$(jq -r '.[$project].owner' --arg project "$PROJECT" < "$FILE") 12REPO=$(jq -r '.[$project].repo' --arg project "$PROJECT" < "$FILE") 13 14REV=$(curl "https://api.github.com/repos/$OWNER/$REPO/branches/$BRANCH" | jq -r '.commit.sha') 15SHA256=$(nix-prefetch-url --unpack "https://github.com/$OWNER/$REPO/archive/$REV.tar.gz") 16TJQ=$(jq '.[$project] = {owner: $owner, repo: $repo, rev: $rev, sha256: $sha256}' \ 17 --arg project "$PROJECT" \ 18 --arg owner "$OWNER" \ 19 --arg repo "$REPO" \ 20 --arg rev "$REV" \ 21 --arg sha256 "$SHA256" \ 22 < "$FILE") 23[[ $? == 0 ]] && echo "${TJQ}" >| "$FILE"