3 getBinDir, getLibDir, getDataDir, getLibexecDir,
4 getDataFileName, getSysconfDir
7 import qualified Control.Exception as Exception
8 import Data.Version (Version(..))
9 import System.Environment (getEnv)
12 catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
13 catchIO = Exception.catch
16 version = Version [0,1,0,0] []
17 bindir, libdir, datadir, libexecdir, sysconfdir :: FilePath
19 bindir = "/home/alexandre/.cabal/bin"
20 libdir = "/home/alexandre/.cabal/lib/x86_64-linux-ghc-7.8.3/hastext-0.1.0.0"
21 datadir = "/home/alexandre/.cabal/share/x86_64-linux-ghc-7.8.3/hastext-0.1.0.0"
22 libexecdir = "/home/alexandre/.cabal/libexec"
23 sysconfdir = "/home/alexandre/.cabal/etc"
25 getBinDir, getLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
26 getBinDir = catchIO (getEnv "hastext_bindir") (\_ -> return bindir)
27 getLibDir = catchIO (getEnv "hastext_libdir") (\_ -> return libdir)
28 getDataDir = catchIO (getEnv "hastext_datadir") (\_ -> return datadir)
29 getLibexecDir = catchIO (getEnv "hastext_libexecdir") (\_ -> return libexecdir)
30 getSysconfDir = catchIO (getEnv "hastext_sysconfdir") (\_ -> return sysconfdir)
32 getDataFileName :: FilePath -> IO FilePath
33 getDataFileName name = do
35 return (dir ++ "/" ++ name)