module Coolbal.Directory where import System.Environment (lookupEnv) import System.Exit (die) import System.IO.Unsafe (unsafePerformIO) currentHomeDirectory :: String currentHomeDirectory = unsafePerformIO $ do var <- lookupEnv "HOME" case var of Just s -> return s Nothing -> die "Cannot get home directory from $HOME environment variable"