Skip to content

Commit 69fe39b

Browse files
committed
just get versions from git tags
1 parent 535dbb7 commit 69fe39b

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

bin/install

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
#!/usr/bin/env bash
22

3-
ghc_version () {
4-
local version=$1
5-
local url="https://downloads.haskell.org/~ghc/${version}/"
6-
curl -s "$url" | grep -oE 'ghc-[^-]+' | head -n 1 | sed -e 's/ghc-//g'
7-
}
8-
93
ghc_install() {
104
local install_type=$1
11-
local release=$2
12-
local version=$(ghc_version $release)
5+
local version=$2
136
local install_path=$3
147

158
local tmp_dir=$(mktemp -d -t haskell_XXXXXXX)

bin/list-all

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
#!/usr/bin/env bash
22

3-
ghc_releases=https://downloads.haskell.org/~ghc/
4-
5-
# stolen from https://github.com/rbenv/ruby-build/pull/631/files#diff-fdcfb8a18714b33b07529b7d02b54f1dR942
6-
function sort_versions() {
7-
sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' | \
8-
LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}'
9-
}
10-
11-
function ghc_versions () {
12-
curl -s "$ghc_releases" | grep -oE '[0-9]+\.[^/]+' | uniq
13-
}
14-
15-
versions="$(ghc_versions | sort_versions)"
16-
17-
echo $versions
3+
# just print releases
4+
echo $(git ls-remote --tags --refs https://github.com/ghc/ghc "*release" |
5+
sed 's;^.*refs/tags/ghc-\(.*\)-release$;\1;')

0 commit comments

Comments
 (0)