Safe Haskell | None |
---|---|
Language | Haskell2010 |
Facilities for inferring an application version
Various inputs are checked: files written during a docker build, git information, or falling back to an unknown version. This is useful for Bugsnag reports, client age comparison, etc.
Synopsis
- data AppVersion = AppVersion {
- avName :: Text
- avCreatedAt :: UTCTime
- getAppVersion :: MonadUnliftIO m => m AppVersion
- tryGetAppVersion :: MonadUnliftIO m => FilePath -> m (Either [String] AppVersion)
Documentation
data AppVersion Source #
AppVersion | |
|
Instances
Eq AppVersion Source # | |
Defined in Freckle.App.Version (==) :: AppVersion -> AppVersion -> Bool # (/=) :: AppVersion -> AppVersion -> Bool # | |
Show AppVersion Source # | |
Defined in Freckle.App.Version showsPrec :: Int -> AppVersion -> ShowS # show :: AppVersion -> String # showList :: [AppVersion] -> ShowS # | |
HasAppVersion AppVersion Source # | |
Defined in Freckle.App.Bugsnag |
getAppVersion :: MonadUnliftIO m => m AppVersion Source #
Attempt to infer an AppVersion
- If files exist under
/app-version
they ar read, otherwise - If we're in a Git repository commit information is used, otherwise
- An Unknown version as of the current time is returned
tryGetAppVersion :: MonadUnliftIO m => FilePath -> m (Either [String] AppVersion) Source #
A more testable version of getAppVersion
- Reports what didn't work in
Left
- Accepts a parent path, for file-system version information