1 parent ccd6598 commit 7a0003aCopy full SHA for 7a0003a
1 file changed
glean/github/Glean/BuildInfo.hs
@@ -16,6 +16,8 @@ import Language.Haskell.TH
16
import System.Exit
17
import System.Process
18
19
+import Util.Control.Exception
20
+
21
buildRule :: Text
22
buildRule = "glean"
23
@@ -30,9 +32,9 @@ buildTimeISO8601 = $(do
30
32
31
33
buildRevision :: Text
34
buildRevision = $(do
- (exit, rev, _) <- liftIO $
35
+ res <- liftIO $ tryAll $
36
readProcessWithExitCode "git" ["rev-parse", "HEAD"] ""
- case exit of
- ExitSuccess -> litE (stringL (head (lines rev)))
37
+ case res of
38
+ Right (ExitSuccess, rev, _) -> litE (stringL (head (lines rev)))
39
_ -> litE (stringL "<unknown>")
40
)
0 commit comments