From 127840e0a237e332b1f4ab88eb63a28f810b9b6b Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Mon, 17 Jun 2019 23:17:06 +0200 Subject: ci: Move stack resolver table to a file --- scripts/ci/update-stack-resolvers.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 scripts/ci/update-stack-resolvers.sh (limited to 'scripts/ci/update-stack-resolvers.sh') diff --git a/scripts/ci/update-stack-resolvers.sh b/scripts/ci/update-stack-resolvers.sh new file mode 100755 index 0000000..d0dacd1 --- /dev/null +++ b/scripts/ci/update-stack-resolvers.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Example: +# $ scripts/ci/update-stack-resolvers.sh | tee tests/stack-resolvers + +mkdir -p /tmp/stack-resolvers/ + +wget -q https://s3.amazonaws.com/haddock.stackage.org/snapshots.json \ + -O /tmp/stack-resolvers/snapshots.json + +resolvers=$(cat /tmp/stack-resolvers/snapshots.json \ + | jq -r '.[]' | grep ^lts- | sort -V -r | uniq) + +for res in $resolvers; do + wget -q --continue \ + -O /tmp/stack-resolvers/$res.yaml \ + https://raw.githubusercontent.com/fpco/lts-haskell/master/$res.yaml + + ghc=$(cat /tmp/stack-resolvers/$res.yaml \ + | grep ghc-version | awk '{ print $2 }' | tr -cd '0-9.') + + printf '%-10s %s\n' "$ghc" "$res" +done -- cgit v1.2.3