Skip to content

Commit 6f7c3c3

Browse files
simonmarmeta-codesync[bot]
authored andcommitted
Don't require git to be installed (#633)
Summary: Fixes #589 Pull Request resolved: #633 Reviewed By: aahanaggarwal Differential Revision: D89051811 Pulled By: phlalx fbshipit-source-id: c790e66b26b640e6115b1c9fe3e7e40b444ec494
1 parent e1ffb8a commit 6f7c3c3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

glean/github/Glean/BuildInfo.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import Language.Haskell.TH
1616
import System.Exit
1717
import System.Process
1818

19+
import Util.Control.Exception
20+
1921
buildRule :: Text
2022
buildRule = "glean"
2123

@@ -30,9 +32,9 @@ buildTimeISO8601 = $(do
3032

3133
buildRevision :: Text
3234
buildRevision = $(do
33-
(exit, rev, _) <- liftIO $
35+
res <- liftIO $ tryAll $
3436
readProcessWithExitCode "git" ["rev-parse", "HEAD"] ""
35-
case exit of
36-
ExitSuccess -> litE (stringL (head (lines rev)))
37+
case res of
38+
Right (ExitSuccess, rev, _) -> litE (stringL (head (lines rev)))
3739
_ -> litE (stringL "<unknown>")
3840
)

0 commit comments

Comments
 (0)