@@ -1,6 +1,13 @@
1module Obelisk.ExecutableConfig (get) where
1module Obelisk.ExecutableConfig (get) where
3+import Control.Exception
3import Data.Text (Text)
4import Data.Text (Text)
6+import Data.Text.IO as T
7+import System.FilePath.Posix ((</>))
5get :: Text -> IO (Maybe Text)
10get :: Text -> IO (Maybe Text)
6−get _ = return Nothing
11+get path = do
12+ let doesNotExist = \e -> if isDoesNotExistError e then Just () else Nothing
13+ catchJust doesNotExist (fmap Just $ T.readFile $ "config" </> T.unpack path) (\_ -> pure Nothing)