Skip to content

Commit

Permalink
1.8.23: check branch earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Sep 12, 2020
1 parent c7ffe40 commit b9f0c55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions bump.nim
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,16 @@ proc bump*(minor = false; major = false; patch = true; release = false;
debug sought.message
target = sought.found.get

# if we're not on the master branch, let's just bail for now
let
branch = appearsToBeMasterBranch()
if branch.isNone:
crash "uh oh; i cannot tell if i'm on the master branch"
elif not branch.get:
crash "i'm afraid to modify any branch that isn't master"
else:
debug "good; this appears to be the master branch"

# make a temp file in an appropriate spot, with a significant name
let
temp = createTemporaryFile(target.package, dotNimble)
Expand Down Expand Up @@ -533,16 +543,6 @@ proc bump*(minor = false; major = false; patch = true; release = false;
debug "dry run and done"
return

# if we're not on the master branch, let's just bail for now
let
branch = appearsToBeMasterBranch()
if branch.isNone:
crash "uh oh; i cannot tell if i'm on the master branch"
elif not branch.get:
crash "i'm afraid to modify any branch that isn't master"
else:
debug "good; this appears to be the master branch"

# copy the new .nimble over the old one
try:
debug &"copying {temp} over {target}"
Expand Down
2 changes: 1 addition & 1 deletion bump.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.8.22"
version = "1.8.23"
author = "disruptek"
description = "a tiny tool to bump nimble versions"
license = "MIT"
Expand Down

0 comments on commit b9f0c55

Please sign in to comment.