Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hoogle will now use the `$XDG_DATA_DIR` instead of `~/.hoogle` as
default path but still keep use the old one as a fallback.
  • Loading branch information
jokesper committed Aug 26, 2024
1 parent 8149c93 commit 35f85f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Action/CmdLine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ data CmdLine

defaultDatabaseLang :: Language -> IO FilePath
defaultDatabaseLang lang = do
dir <- getAppUserDataDirectory "hoogle"
xdgLocation <- getXdgDirectory XdgData "hoogle"
legacyLocation <- getAppUserDataDirectory "hoogle"
canIgnoreLegacyPath <- not <$> doesPathExist legacyLocation
let dir = if canIgnoreLegacyPath then xdgLocation else legacyLocation
pure $ dir </> "default-" ++ lower (show lang) ++ "-" ++ showVersion (trimVersion 3 version) ++ ".hoo"

getCmdLine :: [String] -> IO CmdLine
Expand Down

0 comments on commit 35f85f5

Please sign in to comment.