Skip to content

Commit

Permalink
0.3.4: tag with prefix; fixes #66
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Dec 16, 2019
1 parent ee98b41 commit 75a6822
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nimph.nimble
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version = "0.3.3"
version = "0.3.4"
author = "disruptek"
description = "nim package handler from the future"
license = "MIT"
requires "nim >= 1.0.4"
requires "compiler >= 1.0.4"
requires "github >= 1.0.2"
requires "cligen >= 0.9.41"
requires "bump >= 1.8.16"
requires "bump >= 1.8.17"
requires "nimgit2 >= 0.1.1"
requires "npeg >= 0.21.3"
requires "https://github.com/disruptek/cutelog#1.1.1"
Expand Down
4 changes: 2 additions & 2 deletions src/nimph/doctor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ proc fixTags*(project: var Project; dry_run = true): bool =
else:
# try to create a tag for this version and commit
var oid: GitOid = nil
gitTrap oid, tagCreateLightweight(oid, commit.owner, $version,
commit):
let nextTag = project.tags.nextTagFor(version)
gitTrap oid, tagCreateLightweight(oid, commit.owner, nextTag, commit):
notice &"unable to create new tag for {version}"

# if that worked, let them know we did something
Expand Down
9 changes: 9 additions & 0 deletions src/nimph/project.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1040,3 +1040,12 @@ proc upgradeAvailable*(project: var Project): bool =
project.fetchTagTable
let readonly = project
result = readonly.upgradeAvailable

proc nextTagFor*(tags: GitTagTable; version: Version): string =
## produce a new tag given previous tags
var latest: string
# due to sorting, the last tag should be the latest version
for tag in tags.keys:
latest = tag
# add any silly v. prefix as necessary
result = pluckVAndDot(latest) & $version

0 comments on commit 75a6822

Please sign in to comment.