swarm-0.5.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.Version

Description

Query current and upstream Swarm version.

Synopsis

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.