1module Obelisk.ExecutableConfig (get) where
3import Control.Exception
5import Control.Monad.Trans.Maybe
6import Data.ByteString as BS
8import qualified Data.Text as T
9import qualified Data.Text.IO as T
10import qualified Data.Text.Encoding as T
11import Language.Javascript.JSaddle.WKWebView
12import System.FilePath.Posix ((</>))
15get :: Text -> IO (Maybe Text)
16get name = fmap join $ mainBundleResourcePath >>= \mp -> forM mp $ \p ->
17 catchDoesNotExist $ T.readFile $ T.unpack (T.decodeUtf8 p) </> T.unpack name
19catchDoesNotExist :: IO a -> IO (Maybe a)
20catchDoesNotExist f = catchJust doesNotExist (Just <$> f) $ const $ return Nothing
22 doesNotExist e = if isDoesNotExistError e then Just () else Nothing
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list