diff options
Diffstat (limited to 'src/CabalHelper/Compiletime')
-rw-r--r-- | src/CabalHelper/Compiletime/Program/Stack.hs | 10 | ||||
-rw-r--r-- | src/CabalHelper/Compiletime/Types.hs | 1 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/CabalHelper/Compiletime/Program/Stack.hs b/src/CabalHelper/Compiletime/Program/Stack.hs index f0dd766..353e8f1 100644 --- a/src/CabalHelper/Compiletime/Program/Stack.hs +++ b/src/CabalHelper/Compiletime/Program/Stack.hs @@ -46,11 +46,7 @@ import CabalHelper.Compiletime.Types.RelativePath import CabalHelper.Shared.Common getUnit :: QueryEnvI c 'Stack -> CabalFile -> IO (Unit 'Stack) -getUnit - qe@QueryEnv{qeProjLoc=ProjLocStackYaml stack_yaml} - cabal_file@(CabalFile cabal_file_path) - = do - let projdir = takeDirectory stack_yaml +getUnit qe cabal_file@(CabalFile cabal_file_path) = do let pkgdir = takeDirectory cabal_file_path let pkg_name = dropExtension $ takeFileName cabal_file_path look <- paths qe pkgdir @@ -91,7 +87,7 @@ listPackageCabalFiles qe@QueryEnv{qeProjLoc=ProjLocStackYaml stack_yaml} return $ map CabalFile $ lines out where ioerror :: IOError -> IO a - ioerror ioe = (=<<) (fromMaybe (throwIO ioe)) $ runMaybeT $ do + ioerror ioe = (fromMaybe (throwIO ioe) =<<) $ runMaybeT $ do stack_exe <- MaybeT $ findExecutable $ stackProgram $ qePrograms qe stack_ver_str <- liftIO $ trim <$> readStackCmd qe Nothing ["--numeric-version"] @@ -116,6 +112,8 @@ listPackageCabalFiles qe@QueryEnv{qeProjLoc=ProjLocStackYaml stack_yaml} workdirArg :: QueryEnvI c 'Stack -> [String] workdirArg QueryEnv{qeDistDir=DistDirStack mworkdir} = maybeToList $ ("--work-dir="++) . unRelativePath <$> mworkdir +workdirArg QueryEnv{qeDistDir=DistDirCabal{}} = + error "workdirArg: TODO: this case is impossible and should not produce an exhaustiveness warning anymore starting with GHC 8.8" doStackCmd :: (QueryEnvI c 'Stack -> CallProcessWithCwd a) -> QueryEnvI c 'Stack -> Maybe FilePath -> [String] -> IO a diff --git a/src/CabalHelper/Compiletime/Types.hs b/src/CabalHelper/Compiletime/Types.hs index cded136..e79c812 100644 --- a/src/CabalHelper/Compiletime/Types.hs +++ b/src/CabalHelper/Compiletime/Types.hs @@ -32,7 +32,6 @@ import Data.IORef import Data.Version import Data.Typeable import GHC.Generics -import System.FilePath import System.Posix.Types import CabalHelper.Compiletime.Types.RelativePath import CabalHelper.Shared.InterfaceTypes |