change pattern

This commit is contained in:
Mikhail Timofeev
2020-10-06 14:30:00 +03:00
parent 75a1fd1897
commit d6627e143a

View File

@@ -5,7 +5,7 @@ export PATH="$HOME/.ghcup/bin:$PATH"
echo 'export PATH="$PATH:$HOME/.ghcup/bin"' >> "$HOME/.bashrc"
# ghcup output looks like this "x ghc 8.8.3 base-4.13.0.0 hls-powered", need to take all the first versions only(8.8.3 in that case) and avoid pre-release ones
availableVersions=$(ghcup list | grep -v "prerelease" | grep "ghc " | grep -Eo ' ([0-9]*\.){2}[0-9]*' | tr -d ' ')
availableVersions=$(ghcup list -t ghc -r | grep -v "prerelease" | awk '{print $2}')
# Install 3 latest major versions(For instance 8.6.5, 8.8.4, 8.10.2)
minorMajorVersions=$(echo "$availableVersions" | cut -d"." -f 1,2 | uniq | tail -n3)