aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Compiletime/Program/Stack.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/CabalHelper/Compiletime/Program/Stack.hs')
-rw-r--r--src/CabalHelper/Compiletime/Program/Stack.hs5
1 files changed, 5 insertions, 0 deletions
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