cloudflare / cloudflare/semver_bash

parse error for prerelease/build

Open
#19 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
268
Forks
57
PR merge metrics
No merged PRs in 30d

Description

Some string are not parsed correctly.

Adding following code to semverTest() function:

```
local V=
V=1.0.0-beta.1
semverParseInto $V MAJOR MINOR PATCH SPECIAL
echo "$V -> $MAJOR $MINOR $PATCH $SPECIAL"

V=1.0.0+build.1
semverParseInto $V MAJOR MINOR PATCH SPECIAL
echo "$V -> $MAJOR $MINOR $PATCH $SPECIAL"
```

the result is wrong, showing 1.1 instead of 1:

```
1.0.0-beta.1 -> 1.1 0.1 0.1 -beta.1
1.0.0+build.1 -> 1+build.1 0+build.1 0+build.1 +build.1

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.