aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci/update-stack-resolvers.sh22
1 files changed, 22 insertions, 0 deletions
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