drop xdg-basedir dependency
This commit is contained in:
parent
d1ece3796d
commit
62953174b4
13
Main.hs
13
Main.hs
@ -9,15 +9,14 @@ import Data.Configurator
|
||||
import Control.Monad (mapM_, filterM)
|
||||
import Control.Monad.Reader (ReaderT, runReaderT, asks)
|
||||
import System.FilePath (joinPath, takeBaseName, (</>))
|
||||
import System.Directory (removeFile, getDirectoryContents, doesFileExist)
|
||||
import System.IO (readFile)
|
||||
import System.Directory
|
||||
|
||||
import Database.Selda
|
||||
import Database.Selda.SQLite
|
||||
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.IO as T
|
||||
import qualified System.Environment.XDG.BaseDir as X
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.IO as T
|
||||
|
||||
|
||||
data Settings = Settings
|
||||
@ -38,7 +37,7 @@ type Action = ReaderT Settings IO
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
config <- X.getUserConfigFile "bisc" "bisc.conf"
|
||||
config <- getXdgDirectory XdgConfig ("bisc" </> "bisc.conf")
|
||||
settings <- loadSettings config
|
||||
runReaderT clean settings
|
||||
|
||||
@ -112,8 +111,8 @@ deleteData whitelist = do
|
||||
|
||||
loadSettings :: FilePath -> IO Settings
|
||||
loadSettings path = do
|
||||
configdir <- X.getUserConfigDir "qutebrowser"
|
||||
datadir <- X.getUserDataDir "qutebrowser"
|
||||
configdir <- getXdgDirectory XdgConfig "qutebrowser"
|
||||
datadir <- getXdgDirectory XdgData "qutebrowser"
|
||||
let
|
||||
defaultWhitelist = joinPath [configdir, "whitelists", "cookies"]
|
||||
defaultWebengine = joinPath [datadir, "webengine"]
|
||||
|
@ -25,8 +25,8 @@ executable bisc
|
||||
main-is: Main.hs
|
||||
build-depends: base ==4.* , selda ==0.3.*,
|
||||
selda-sqlite ==0.1.*,
|
||||
xdg-basedir, filepath, directory,
|
||||
text, mtl, configurator
|
||||
filepath, directory, text,
|
||||
mtl, configurator
|
||||
default-language: Haskell2010
|
||||
default-extensions: DeriveGeneric, OverloadedStrings
|
||||
OverloadedLabels, FlexibleContexts
|
||||
|
Loading…
Reference in New Issue
Block a user