From bda559bf059ee42e3e01c1280f7a64dd2673d725 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Tue, 6 Aug 2019 19:39:23 +0200 Subject: Refactor Program versions handling This mainly renames the program version getters to get* and make them consistenly return Version directly. Such that wrappers like GhcVersion have to be added at the callsites of the relevant functions. --- src/CabalHelper/Compiletime/Program/Stack.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/CabalHelper/Compiletime/Program/Stack.hs') diff --git a/src/CabalHelper/Compiletime/Program/Stack.hs b/src/CabalHelper/Compiletime/Program/Stack.hs index dc0b0e5..fe817cb 100644 --- a/src/CabalHelper/Compiletime/Program/Stack.hs +++ b/src/CabalHelper/Compiletime/Program/Stack.hs @@ -38,8 +38,13 @@ import Prelude import CabalHelper.Compiletime.Types import CabalHelper.Compiletime.Types.RelativePath +import CabalHelper.Compiletime.Process import CabalHelper.Shared.Common +getStackVersion :: (Verbose, Progs) => IO Version +getStackVersion = + parseVer . trim <$> readProcess' (stackProgram ?progs) [ "--numeric-version" ] "" + getPackage :: QueryEnvI c 'Stack -> CabalFile -> IO (Package 'Stack) getPackage qe cabal_file@(CabalFile cabal_file_path) = do let pkgdir = takeDirectory cabal_file_path -- cgit v1.2.3