diff --git a/.github/workflows/resolver.yaml b/.github/workflows/resolver.yaml index d6c998e..a2b5dd6 100644 --- a/.github/workflows/resolver.yaml +++ b/.github/workflows/resolver.yaml @@ -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 diff --git a/src/Job.hs b/src/Job.hs index e764115..8731548 100644 --- a/src/Job.hs +++ b/src/Job.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TemplateHaskell #-} {- sv2v @@ -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 @@ -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