From b6ab4d8d722d22c3fc9eae9c8689de00ba8d37c2 Mon Sep 17 00:00:00 2001 From: sourabhxyz Date: Wed, 30 Oct 2024 17:25:06 +0530 Subject: [PATCH] feat(#85): use `UNKNOWN_REVISION` when are unable to determine git revision when building bot --- geniusyield-server-lib/CHANGELOG.md | 3 ++- geniusyield-server-lib/src/GeniusYield/Server/Constants.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/geniusyield-server-lib/CHANGELOG.md b/geniusyield-server-lib/CHANGELOG.md index ad0bd1f..38e3002 100644 --- a/geniusyield-server-lib/CHANGELOG.md +++ b/geniusyield-server-lib/CHANGELOG.md @@ -1,8 +1,9 @@ # Revision history for geniusyield-server-lib -## 0.11.1 -- 2024-10-28 +## 0.11.1 -- 2024-10-30 * Adds support of [`prices`](https://openapi.taptools.io/#tag/Market-Tokens/paths/~1token~1prices/post) TapTools endpoint. +* In case project is being built from an environment which lacks access to corresponding `.git` directory, "UNKNOWN_REVISION" is used for `revision` field when querying for settings of the server. ## 0.11.0 -- 2024-08-30 diff --git a/geniusyield-server-lib/src/GeniusYield/Server/Constants.hs b/geniusyield-server-lib/src/GeniusYield/Server/Constants.hs index 0f57a0b..8b7d104 100644 --- a/geniusyield-server-lib/src/GeniusYield/Server/Constants.hs +++ b/geniusyield-server-lib/src/GeniusYield/Server/Constants.hs @@ -9,4 +9,4 @@ import RIO -- | The git hash of the current commit. gitHash ∷ String -gitHash = $$tGitInfoCwd & giHash +gitHash = either (const "UNKNOWN_REVISION") giHash $$tGitInfoCwdTry