module F2Md.Utils (expandPath) where import System.Directory import System.Posix.User expandPath :: FilePath -> IO FilePath expandPath path = let (pre, post) = break (=='/') path in case pre of "~" -> (++ post) <$> getHomeDirectory '~' : user -> (++ post) <$> homeDirectory <$> getUserEntryForName user _ -> return path