Skip to content

Commit

Permalink
Fix stripping VERSION_PREFIX from major versions to prevent creating …
Browse files Browse the repository at this point in the history
…versions with double versions. (#33)

I had a `VERSION_PREFIX=v` which caused my versions to have two "v":

```
➜  fluxcloud git:(master) ✗ git semver --dryrun patch
vv0.2.11
➜  fluxcloud git:(master) ✗
```

Bash does not interpolate variables inside of single quotes, so this fixes the sed
command in version-parse-major to use double quotes so that the VERSION_PREFIX
gets properly stripped.
  • Loading branch information
Justin authored and markchalloner committed Oct 24, 2018
1 parent 86ce36e commit c884191
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-semver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ validate-build() {
########################################

version-parse-major() {
echo "$1" | cut -d "." -f1 | sed 's/^${VERSION_PREFIX}//g'
echo "$1" | cut -d "." -f1 | sed "s/^${VERSION_PREFIX}//g"
}

version-parse-minor() {
Expand Down

0 comments on commit c884191

Please sign in to comment.