Fix UNKNOWN being shown as git commit hash (#1533)

Fixes https://github.com/PostgREST/postgrest/issues/1530
This commit is contained in:
Remo Rechkemmer
2020-05-20 14:10:53 -05:00
committed by GitHub
parent 289bb66f56
commit e6874c866d
2 changed files with 8 additions and 2 deletions
+2
View File
@@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- #1530, Fix how the PostgREST version is shown in the help text when the `.git` directory is not available - @monacoremo
## [7.0.1] - 2020-05-18
### Fixed
+6 -2
View File
@@ -124,8 +124,12 @@ corsPolicy req = case lookup "origin" headers of
-- | User friendly version number
prettyVersion :: Text
prettyVersion =
intercalate "." (map show $ versionBranch version)
<> " (" <> take 7 $(gitHash) <> ")"
intercalate "." (map show $ versionBranch version) <> gitRev
where
gitRev =
if $(gitHash) == "UNKNOWN"
then mempty
else " (" <> take 7 $(gitHash) <> ")"
-- | Version number used in docs
docsVersion :: Text