From b67c9dda1b898f3ddfb6ddd710c886bef9085c94 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Wed, 21 Aug 2019 03:43:37 +0200 Subject: Use plStackProjectDir instead of 'takeDirectory stack_yaml' --- src/CabalHelper/Compiletime/Program/Stack.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/CabalHelper/Compiletime/Program') diff --git a/src/CabalHelper/Compiletime/Program/Stack.hs b/src/CabalHelper/Compiletime/Program/Stack.hs index 0f9e46d..075f46c 100644 --- a/src/CabalHelper/Compiletime/Program/Stack.hs +++ b/src/CabalHelper/Compiletime/Program/Stack.hs @@ -74,8 +74,8 @@ getPackage qe cabal_file@(CabalFile cabal_file_path) = do return pkg projPaths :: QueryEnvI c 'Stack -> IO StackProjPaths -projPaths qe@QueryEnv {qeProjLoc=ProjLocStackYaml stack_yaml} = do - look <- paths qe $ takeDirectory stack_yaml +projPaths qe@QueryEnv {qeProjLoc} = do + look <- paths qe $ plStackProjectDir qeProjLoc return StackProjPaths { sppGlobalPkgDb = PackageDbDir $ look "global-pkg-db:" , sppSnapPkgDb = PackageDbDir $ look "snapshot-pkg-db:" @@ -93,9 +93,9 @@ paths qe@QueryEnv{qeProjLoc=ProjLocStackYaml stack_yaml} cwd split l = let (key, ' ' : val) = span (not . isSpace) l in (key, val) listPackageCabalFiles :: QueryEnvI c 'Stack -> IO [CabalFile] -listPackageCabalFiles qe@QueryEnv{qeProjLoc=ProjLocStackYaml stack_yaml} +listPackageCabalFiles qe@QueryEnv{qeProjLoc} = handle ioerror $ do - let projdir = takeDirectory stack_yaml + let projdir = plStackProjectDir qeProjLoc out <- readStackCmd qe (Just projdir) [ "ide", "packages", "--cabal-files", "--stdout" ] return $ map CabalFile $ lines out -- cgit v1.2.3