semver-git
semver-git copied to clipboard
If no annotated version tags exists snapshotSuffix and dirtyMarker are ignored
This is also an issue if the closest annotated tag is not a semantic version.
Now if git describe only provided SEPARATE exit codes handling this would be easier.
» git describe --dirty --abbrev=7
fatal: No annotated tags can describe '8a999efb9f35b68d9bf36bcb10d4583fcceb6ef9'.
However, there were unannotated tags: try --tags.
» echo $?
128
» git describe --dirty --abbrev=7
fatal: No names found, cannot describe anything.
» echo $?
128
Suggested workaround: push tag 0.0.0 on initial commit.