This makes the comparison between a numeric and a non-numeric release ID
more granular, by trying to parse leading digits in a non-numeric
release ID as a number and comparing it against the numeric ID. If the
two differ, their ordering is used as the ID ordering. If they're equal,
the non-numeric ID is considered greater so long as it has a non-zero
length suffix after the numeric leading digits. This means that
the version
0.78b is correctly considered to be less than the version 0.86, which
was not previously the case.
Pre-release IDs are not affected to avoid not conforming to the Semver
spec, which states that numeric pre-release IDs are always less than
non-numeric pre-release IDs. As non-numeric release IDs are not allowed
in semver, this commit's changes don't change the behaviour for semver
version comparisons.
If an installed plugin has a .ghost extension, remove it before trying
to match the filename against the given regex. This makes functions that
take paths and functions that take regexes behave the same way for
ghosted plugins.
- Don't recursively check .ghost file extensions: plugin.esp.ghost.ghost
is not a valid plugin filename.
- Only add a .ghost file extension if the path that does not exist has
an unghosted plugin file extension.