From 213e94c89626c04dd18d7da898939c3782f0ed4a Mon Sep 17 00:00:00 2001 From: Mats Rauhala Date: Thu, 31 Dec 2020 08:31:31 +0200 Subject: [PATCH] Get a proper working directory --- app/Main.hs | 5 ++++- buuka.cabal | 1 + default.nix | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index 9edd49a..45972d5 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -7,6 +7,9 @@ import Control.Monad.Buuka import Data.Environment +import UnliftIO.Directory + (XdgDirectory(XdgData), getXdgDirectory) + import qualified Operations commands :: Parser (BuukaM ()) @@ -19,5 +22,5 @@ commands = subparser main :: IO () main = do - let env = Environment "." + env <- Environment <$> getXdgDirectory XdgData "buuka" execParser (info (commands <**> helper) fullDesc) >>= runBuukaM env diff --git a/buuka.cabal b/buuka.cabal index 09c0cb3..bdff1c1 100644 --- a/buuka.cabal +++ b/buuka.cabal @@ -61,6 +61,7 @@ executable buuka -- other-extensions: build-depends: buuka , optparse-applicative + , unliftio hs-source-dirs: app test-suite buuka-test diff --git a/default.nix b/default.nix index 0b34698..8fcdb78 100644 --- a/default.nix +++ b/default.nix @@ -13,7 +13,7 @@ mkDerivation { aeson base bytestring conduit conduit-extra containers exceptions filepath mtl transformers unliftio yaml ]; - executableHaskellDepends = [ base optparse-applicative ]; + executableHaskellDepends = [ base optparse-applicative unliftio ]; testHaskellDepends = [ aeson base hedgehog hedgehog-corpus tasty tasty-hedgehog text ];