Skip to content

Commit

Permalink
add a way to check that we're on master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Oct 23, 2019
1 parent f60336d commit d9f3ebe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bump.nim
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ proc run*(exe: string; args: varargs[string]): bool =
arguments.add n
result = capture(exe, arguments).ok

proc appearsToBeMasterBranch(): Option[bool] =
## try to determine if we're on the `master` branch
let
caught = capture("git", @["branch", "--show-current"])
if not caught.ok:
return
result = caught.output.contains(re"^\s*master\s*$").some
proc tagsAppearToStartWithV(): Option[bool] =
## try to determine if this project's git tags start with a `v`
let
Expand Down

0 comments on commit d9f3ebe

Please sign in to comment.