bhoogle 0.1.2.5 → 0.1.2.6
raw patch · 2 files changed
+9/−18 lines, 2 files
Files
- app/Main.hs +8/−17
- bhoogle.cabal +1/−1
app/Main.hs view
@@ -25,7 +25,6 @@ import qualified Graphics.Vty as V import qualified Graphics.Vty.Input.Events as K import System.FilePath ((</>))-import qualified System.FilePath as FP import qualified System.Directory as Dir import qualified Hoogle as H @@ -74,28 +73,20 @@ main :: IO () main = do- -- Try use the default hoogle DB. This may not exist because+ -- Use the default hoogle DB. This may not exist because -- 1) hoogle generate was never called -- 2) the system hoogle is a different version from the package used here dbPath <- H.defaultDatabaseLocation Dir.doesFileExist dbPath >>= \case True -> runBHoogle dbPath False -> do- -- Try find the latest "hoo" DB in the default path- let root = FP.takeDirectory dbPath- files <- Txt.pack <<$>> getFiles root- let hoos = filter (Txt.isSuffixOf ".hoo") files-- case sortBy (flip compare) hoos of- (path:_) -> runBHoogle $ Txt.unpack path- _ -> do- putText ""- putText "bhoogle error: "- putText " default hoogle database not found"- putText $ " at " <> Txt.pack dbPath- putText " You can create the database by installing hoogle and running"- putText " hoogle generate"- putText ""+ putText ""+ putText "bhoogle error: "+ putText " default hoogle database not found"+ putText $ " at " <> Txt.pack dbPath+ putText " You can create the database by installing hoogle and running"+ putText " hoogle generate"+ putText "" runBHoogle :: FilePath -> IO ()
bhoogle.cabal view
@@ -1,5 +1,5 @@ name: bhoogle-version: 0.1.2.5+version: 0.1.2.6 synopsis: Simple terminal GUI for local hoogle. description: bhoogle is a terminal GUI layer over local hoogle. It provides search ahead and sub-string filtering in addition to the usual type-search. homepage: https://github.com/andrevdm/bhoogle#readme