License | BSD-3-Clause |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Query current and upstream Swarm version.
Synopsis
- isSwarmReleaseTag :: String -> Bool
- version :: String
- tagToVersion :: String -> Version
- upstreamReleaseVersion :: IO (Either NewReleaseFailure String)
- getNewerReleaseVersion :: Maybe GitInfo -> IO (Either NewReleaseFailure String)
- data NewReleaseFailure where
PVP version
isSwarmReleaseTag :: String -> Bool Source #
Check that the tag follows the PVP versioning policy.
Note that this filters out VS Code plugin releases.
Upstream release
tagToVersion :: String -> Version Source #
Read Swarm tag as Version.
Swarm tags follow the PVP versioning scheme, so comparing them makes sense.
>>>
map (first versionBranch) $ readP_to_S parseVersion "0.1.0.0"
[([0],".1.0.0"),([0,1],".0.0"),([0,1,0],".0"),([0,1,0,0],"")]>>>
Version [0,0,0,1] [] < tagToVersion "0.1.0.0"
True
upstreamReleaseVersion :: IO (Either NewReleaseFailure String) Source #
Get the current upstream release version if any.
getNewerReleaseVersion :: Maybe GitInfo -> IO (Either NewReleaseFailure String) Source #
Get a newer upstream release version.
This function can fail if the current branch is not main, if there is no Internet connection or no newer release.
data NewReleaseFailure where Source #
Instances
Show NewReleaseFailure Source # | |
Defined in Swarm.Version showsPrec :: Int -> NewReleaseFailure -> ShowS # show :: NewReleaseFailure -> String # showList :: [NewReleaseFailure] -> ShowS # |