Skip to content

Commit

Permalink
Merge pull request #20 from schubergphilis/fix_version_bump
Browse files Browse the repository at this point in the history
fixing the version bump within the choose_version function.
  • Loading branch information
isoutham committed Nov 8, 2013
2 parents 5008e23 + b64fe2d commit 0572dea
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/chef/knife/github_deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,20 @@ def choose_version(version)
major = $1
minor = $2
patch = $3
major = major.to_i + 1 if config[:major]
minor = minor.to_i + 1 if config[:minor]
if config[:major]
major = major.to_i + 1
minor = 0
patch = 0
end
if config[:minor]
minor = minor.to_i + 1
patch = 0
end
patch = patch.to_i + 1 if config[:patch]
version = "#{major}.#{minor}.#{patch}"
Chef::Log.debug("New version is #{version}")
else
Chef::Log.error("Version is in a format I cannot auto auto-update")
Chef::Log.error("Version is in a format I cannot auto-update")
exit 1
end
version
Expand Down

0 comments on commit 0572dea

Please sign in to comment.