Skip to content

Commit 168c97a

Browse files
committed
bump-all-cabal-hashes: init
1 parent d806205 commit 168c97a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Diff for: bump-all-cabal-hashes/updater

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#! /usr/bin/env nix-shell
2+
#! nix-shell -i bash
3+
#! nix-shell -p curl jq nix
4+
5+
set -eufo pipefail
6+
7+
FILE=$1
8+
9+
OWNER=$(jq -r '.owner' < "$FILE")
10+
REPO=$(jq -r '.repo' < "$FILE")
11+
12+
JSON=$(curl "https://api.github.com/repos/$OWNER/$REPO/branches/$BRANCH")
13+
REV=$(echo "$JSON" | jq -r '.commit.sha')
14+
MESSAGE=$(echo "$JSON" | jq -r '.commit.commit.message')
15+
SHA256=$(nix-prefetch-url "https://github.com/$OWNER/$REPO/archive/$REV.tar.gz")
16+
TJQ=$(jq '{owner: $owner, repo: $repo, branch: $branch, message: $message, rev: $rev, sha256: $sha256}' \
17+
--arg owner "$OWNER" \
18+
--arg repo "$REPO" \
19+
--arg branch "$BRANCH" \
20+
--arg message "$MESSAGE" \
21+
--arg rev "$REV" \
22+
--arg sha256 "$SHA256" \
23+
< "$FILE")
24+
[[ $? == 0 ]] && echo "${TJQ}" >| "$FILE"

Diff for: bump-all-cabal-hashes/versions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"owner": "commercialhaskell",
3+
"repo": "all-cabal-hashes",
4+
"branch": "hackage",
5+
"message": "Update from Hackage at 2018-10-23T16:25:20Z",
6+
"rev": "ddf5d77fc413fae14c26c408a33860118e16b878",
7+
"sha256": "0aib4nq439b8rzilxfndv5gswpajncb9pyjz9jmzv97bbp4rjgg5"
8+
}

0 commit comments

Comments
 (0)