[Ubuntu] Simplify ghcup code (#4126)

This commit is contained in:
Julian Ospald
2021-09-22 18:32:16 +02:00
committed by GitHub
parent 75380ebaa3
commit 0d16297bf7

View File

@@ -30,9 +30,7 @@ for majorMinorVersion in $minorMajorVersions; do
ghcup set ghc $fullVersion
# remove docs and profiling libs
ghc_bin_dir="$(ghcup whereis --directory ghc $fullVersion)"
[ -e "${ghc_bin_dir}" ] || exit 1
ghc_dir="$(realpath "${ghc_bin_dir}"/..)"
ghc_dir="$(ghcup whereis basedir)/ghc/$fullVersion"
[ -e "${ghc_dir}" ] || exit 1
find "${ghc_dir}" \( -name "*_p.a" -o -name "*.p_hi" \) -type f -delete
rm -r "${ghc_dir}"/share/*