mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-18 12:26:08 +00:00
26 lines
792 B
Haskell
26 lines
792 B
Haskell
import Distribution.Simple
|
|
|
|
import Control.Applicative ((<$>))
|
|
import Data.List (isInfixOf)
|
|
import Codec.Archive.Tar (create)
|
|
import System.Directory (getDirectoryContents)
|
|
|
|
-- This is currently *not used*. build-type is Simple.
|
|
-- This is because it breaks installing from Hackage.
|
|
main = defaultMainWithHooks simpleUserHooks {
|
|
preBuild = makeProfileTar
|
|
}
|
|
|
|
makeProfileTar args flags = do
|
|
putStrLn "Building profile.tar."
|
|
|
|
let profileDir = "profile"
|
|
tarFile = profileDir ++ "/profile.tar"
|
|
files <- filter realFile <$> filter notProfileTar <$> getDirectoryContents profileDir
|
|
print files
|
|
create tarFile profileDir files
|
|
preBuild simpleUserHooks args flags
|
|
where
|
|
notProfileTar str = not $ "profile.tar" `isInfixOf` str
|
|
realFile str = str /= "." && str /= ".."
|