Skip to content

Commit

Permalink
Depracted legacy location
Browse files Browse the repository at this point in the history
  • Loading branch information
jokesper committed Feb 8, 2024
1 parent 764d416 commit d548d81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Changelog for Hoogle (* = API change, @ = database format change)

#411, switched to xdg directory and depracted legacy location
#380, move results before left anchors in tab focus order
5.0.18.3, released 2021-12-24
Compatibility with aeson-2.0
Expand Down
3 changes: 3 additions & 0 deletions src/Action/CmdLine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Action.CmdLine(
whenLoud, whenNormal
) where

import Control.Monad (unless)
import Data.List.Extra
import Data.Version
import General.Util
Expand All @@ -16,6 +17,7 @@ import System.Console.CmdArgs
import System.Directory
import System.Environment
import System.FilePath
import System.IO

data Language = Haskell | Frege deriving (Data,Typeable,Show,Eq,Enum,Bounded)

Expand Down Expand Up @@ -83,6 +85,7 @@ defaultDatabaseLang lang = do
xdgLocation <- getXdgDirectory XdgData "hoogle"
legacyLocation <- getAppUserDataDirectory "hoogle"
canIgnoreLegacyPath <- not <$> doesPathExist legacyLocation
unless canIgnoreLegacyPath (hPutStrLn stderr "Warning: ~/.hoogle is deprected. Consider moving it to $XDG_DATA_HOME/hoogle (commonly ~/.local/share/hoogle)")
let dir = if canIgnoreLegacyPath then xdgLocation else legacyLocation
pure $ dir </> "default-" ++ lower (show lang) ++ "-" ++ showVersion (trimVersion 3 version) ++ ".hoo"

Expand Down

0 comments on commit d548d81

Please sign in to comment.