aboutsummaryrefslogtreecommitdiff
path: root/Distribution
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2015-04-03 01:20:37 +0200
committerDaniel Gröber <dxld@darkboxed.org>2015-04-03 01:23:00 +0200
commitb1e488bbb31140ee175405416076d10a0403bd67 (patch)
tree40355f78e64a7b087a0a367811c04b8cc0746191 /Distribution
parentb5575e1245b6f7e76c79e1231c85cec1409e623d (diff)
Add `buildPlatform`
Diffstat (limited to 'Distribution')
-rw-r--r--Distribution/Helper.hs8
1 files changed, 8 insertions, 0 deletions
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