I've successfully used the GitHash module to bake things like the branch name and commit hash into programs.
Are there any other, similar, modules for extracting data from package.yaml
in a similar way? (I guess TemplateHaskell is involved?) Specifically, for the moment, I'm interested in the version string, but a wider-reaching solution would be potentially very useful.
There is a special module that contains a packages own version, among other things: Paths_*pkgname*
(link to the relevant section of Cabal's documentation).
The
Paths_pkgname
module also includes some other useful functions and values, which record the version of the package and some other directories which the package has been configured to be installed into (e.g. data files live ingetDataDir
):version :: Version getBinDir :: IO FilePath getLibDir :: IO FilePath getDynLibDir :: IO FilePath getDataDir :: IO FilePath getLibexecDir :: IO FilePath getSysconfDir :: IO FilePath
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With