Skip to content

Commit

Permalink
tolerate incompatible githash
Browse files Browse the repository at this point in the history
  • Loading branch information
zachjs committed May 5, 2024
1 parent 4a4aa79 commit caf9abd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/resolver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- lts-15
- lts-14
- lts-13
- lts-12
steps:
- uses: actions/checkout@v4
- run: stack build --resolver ${{ matrix.resolver }}
- run: stack exec sv2v --resolver ${{ matrix.resolver }} -- --help
7 changes: 7 additions & 0 deletions src/Job.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TemplateHaskell #-}
{- sv2v
Expand All @@ -12,7 +13,9 @@ import Control.Monad (when)
import Data.Char (toLower)
import Data.List (isPrefixOf, isSuffixOf)
import Data.Version (showVersion)
#if MIN_VERSION_githash(0,1,5)
import GitHash (giTag, tGitInfoCwdTry)
#endif
import qualified Paths_sv2v (version)
import System.IO (stderr, hPutStr)
import System.Console.CmdArgs
Expand Down Expand Up @@ -53,7 +56,11 @@ data Job = Job
} deriving (Typeable, Data)

version :: String
#if MIN_VERSION_githash(0,1,5)
version = either (const backup) giTag $$tGitInfoCwdTry
#else
version = backup
#endif
where backup = showVersion Paths_sv2v.version

defaultJob :: Job
Expand Down

0 comments on commit caf9abd

Please sign in to comment.