Minor revision
[hadrian.git] / build.cabal.sh
index 973cd3e..2a0e8a7 100755 (executable)
@@ -42,14 +42,13 @@ CABVERSTR=$("$CABAL" --numeric-version)
 
 CABVER=( ${CABVERSTR//./ } )
 
-if [ "${CABVER[0]}" -eq 1 -a "${CABVER[1]}" -ge 24 ]; then
+if [ "${CABVER[0]}" -eq 2 -o "${CABVER[0]}" -eq 1 -a "${CABVER[1]}" -ge 24 ]; then
     # New enough cabal version detected, so
     # let's use the superior 'cabal new-build' mode
 
     # there's no 'cabal new-run' yet, but it's easy to emulate
     "$CABAL" new-build --disable-profiling --disable-documentation -j exe:hadrian
-    PKGVER="$(awk '/^version:/ { print $2 }' hadrian.cabal)"
-    "./dist-newstyle/build/hadrian-${PKGVER}/build/hadrian/hadrian" \
+    $(find ./dist-newstyle -type f -name hadrian | head -n 1) \
         --lint                         \
         --directory "$absoluteRoot/.." \
         "$@"