diff --git a/cabal.project b/cabal.project index 6f20974..b34fe5f 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,3 @@ packages: . bench/ - script/ diff --git a/script/GenCaseFold.hs b/script/GenCaseFold.hs index b1da89b..1c203af 100644 --- a/script/GenCaseFold.hs +++ b/script/GenCaseFold.hs @@ -1,3 +1,7 @@ +#!/usr/bin/env cabal +{- cabal: +build-depends: base, containers, parser-regex, text +-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} @@ -15,9 +19,6 @@ import qualified Data.Text as T import qualified Data.Text.IO.Utf8 as T import qualified Regex.Text as R --- TODO: Switch to cabal script once it's on Hackage. --- Otherwise it doesn't work: https://github.com/haskell/cabal/issues/8562 - main :: IO () main = do args <- getArgs diff --git a/script/case.sh b/script/case.sh index 34fd6cf..c69905b 100755 --- a/script/case.sh +++ b/script/case.sh @@ -2,10 +2,12 @@ set -eu echo "Downloading CaseFolding.txt..." -curl --output script/script-data/CaseFolding.txt \ +curl --create-dirs \ + --output script/script-data/CaseFolding.txt \ https://www.unicode.org/Public/UCD/latest/ucd/CaseFolding.txt echo "Downloaded" echo "Generating hs..." -cabal run script -- script/script-data/CaseFolding.txt \ +cabal run script/GenCaseFold.hs -- \ + script/script-data/CaseFolding.txt \ src/Regex/Internal/Generated/CaseFold.hs \ Regex.Internal.Generated.CaseFold diff --git a/script/script.cabal b/script/script.cabal deleted file mode 100644 index b4bdb30..0000000 --- a/script/script.cabal +++ /dev/null @@ -1,17 +0,0 @@ -cabal-version: 2.4 -name: script -version: 0.1.0.0 - -executable script - ghc-options: -Wall - - build-depends: - base - , containers - , parser-regex - , text - - hs-source-dirs: . - main-is: GenCaseFold.hs - default-language: Haskell2010 - type: exitcode-stdio-1.0