From b1e488bbb31140ee175405416076d10a0403bd67 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Fri, 3 Apr 2015 01:20:37 +0200 Subject: Add `buildPlatform` --- Distribution/Helper.hs | 8 ++++++++ cabal-helper.cabal | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Distribution/Helper.hs b/Distribution/Helper.hs index 44b17bb..b06ffe4 100644 --- a/Distribution/Helper.hs +++ b/Distribution/Helper.hs @@ -38,6 +38,9 @@ module Distribution.Helper ( , ChComponentName(..) , ChEntrypoint(..) + -- * General information + , buildPlatform + -- * Managing @dist/@ , reconfigure , writeAutogenFiles @@ -204,6 +207,11 @@ writeAutogenFiles distdir = liftIO $ do exe <- findLibexecExe "cabal-helper-wrapper" void $ readProcess exe [distdir, "write-autogen-files"] "" +buildPlatform :: IO String +buildPlatform = do + exe <- findLibexecExe "cabal-helper-wrapper" + dropWhileEnd isSpace <$> readProcess exe ["print-build-platform"] "" + -- | This exception is thrown by all 'runQuery' functions if the internal -- wrapper executable cannot be found. You may catch this and present the user -- an appropriate error message however the default is to print diff --git a/cabal-helper.cabal b/cabal-helper.cabal index 5121a78..1fbaa63 100644 --- a/cabal-helper.cabal +++ b/cabal-helper.cabal @@ -1,5 +1,5 @@ name: cabal-helper -version: 0.3.0.0 +version: 0.3.1.0 synopsis: Simple interface to Cabal's configuration state used by ghc-mod description: @cabal-helper@ provides a library which wraps the internal use of executables -- cgit v1.2.3